Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new project seems to require an (undocumented) step on Linux #85

Open
jbreckmckye opened this issue Jul 6, 2024 · 0 comments

Comments

@jbreckmckye
Copy link

jbreckmckye commented Jul 6, 2024

This is a small issue and I was able to resolve it eventually - but it did seem to take some time to figure out.

I've just moved over from Windows to Linux (Ubuntu) and had a bit of trouble getting the CMake scripts to work. (It's not a tool I'm very familiar with)

When I ran cmake --preset default . I would get the output

$ cmake --preset default .

Preset CMake variables:
  CMAKE_BUILD_TYPE="Debug"
  PSN00BSDK_TARGET="mipsel-none-elf"
  PSN00BSDK_TC=""

CMake Error at CMakeLists.txt:14 (psn00bsdk_add_executable):
  Unknown CMake command "psn00bsdk_add_executable".

-- Configuring incomplete, errors occurred!

This was surprising because the library path environment variable was set up correctly:

$ echo $PSN00BSDK_LIBS
/opt/psn00bsdk/lib/libpsn00b

Turns out (?) I needed to run an extra step, which I actually found in the instructions for building the examples:

cmake -S . -B ./build -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=/opt/psn00bsdk/lib/libpsn00b/cmake/sdk.cmake

I think this works because it adds a CMake cache entry CMAKE_TOOLCHAIN_FILE:FILEPATH="/cmake/sdk.cmake". Again, I'm not sure if it's 'supposed' to rely on this, I know next to nothing about CMake.

Weirdly this isn't strictly required on Windows. On Windows I have build scripts that delete the /build dir every time, but this caused issues on Linux.

tl;dr: the Installation.md may be missing a step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant