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

Full CMake support (in place of makefiles) #38

Closed spicyjpeg closed 2 years ago

spicyjpeg commented 2 years ago

I just finished my CMake branch and got rid of all Makefiles.

The SDK has to be installed before usage, but installation (including downloading and building mkpsxiso) is fully automated. Optionally CPack can be used to build NSIS installers with custom branding as well as DEB/RPM packages; combined with a precompiled toolchain this could provide an effortless way to get the SDK running on any OS, far better than the current mess of environment variables to set manually.

Once installed the SDK can be used simply by telling CMake to include the libpsn00b/cmake/sdk.cmake toolchain file. This script takes care of finding the toolchain (it searches several common install locations) and configuring CMake to use it. It also provides shorthand functions for quickly building PS1 executables, DLLs and CD images. Linking and compiler flags are handled entirely behind the scenes.

I updated the documentation and installation guide to reflect the new build system, and added a CMake reference listing all functions and variables that can be used in build scripts. The template is also installed alongside the docs, making it easier to create new projects.

IMPORTANT: there are a few things in CMakeLists.txt that need to be changed when merging, particularly the version numbers and mkpsxiso repo URL (I temporarily set it to my fork as the installation step depends on some changes I made in PR #18).