building
rollnw uses cmake as its build system and more specifically CMakePresets.json.
To build the library, all one needs to do is use the following cmake commands. This example also builds tests which are not enabled by default.
$ cd path/to/rollnw
$ cmake --preset linux -DROLLNW_BUILD_TESTS=ON
$ cmake --build --preset default
$ ctest --preset default
Note
The deployment target is currently set to 12.
$ cd path/to/rollnw
$ cmake --preset macos -DROLLNW_BUILD_TESTS=ON
$ cmake --build --preset default
$ ctest --preset default
The main windows builds are for Visual Studio 2022 (Community Edition), but mingw-64, later versions of Visual Studio will added.
For now it’s probably easiest to open the x64 Visual Studio Developer Command Prompt.
If you have ninja installed, it’s highly recommended to use the windows-ninja
configuration
preset.
$ cd path/to/rollnw
$ cmake --preset windows -DROLLNW_BUILD_TESTS=ON
$ cmake --build --preset default
$ ctest --preset default
- In order to run all of the tests, you can help the library locate Neverwinter Nights installation
paths by exporting the following ENV vars, if your install is in a non-standard location:
$ export NWN_ROOT=path/to/game
$ export NWN_USER=path/to/nwn-user-dir
set NWN_ROOT=path\to\game
set NWN_USER=path\to\nwn-user-dir