Lameguy64 / PSn00bSDK

The most powerful open source SDK for the PS1 (as far as open source PS1 SDKs go). Not recommended for beginner use.
Other
819 stars 66 forks source link

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

Open jbreckmckye opened 2 months ago

jbreckmckye commented 2 months ago

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