forgottenserver
forgottenserver copied to clipboard
Use Ninja multi-config with CMake
Pull Request Prelude
- [x] I have followed proper The Forgotten Server code styling.
- [x] I have read and understood the contribution guidelines before making this PR.
- [x] I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.
Changes Proposed
Issues addressed:
Using Ninja multi-config allows us to build in multiple configurations, such as Debug, RelWithDebInfo and Release.
Currently, one needs to pass the build type prior to generating makefiles, with cmake --preset default -DCMAKE_BUILD_TYPE=<buildtype> followed by cmake --build --preset default, and rebuilding with a different config required regenerating makefiles.
Now, a clearer invocation of cmake is possible with cmake --preset default to generate makefiles, and then cmake --build --preset default --config <buildtype> is possible without regenerating makefiles, and in separate folders so that one can maintain multiple builds (for debugging and running in production, for example)