Using Visual Studio IDE
- You can either directly open the cmake project in Visual Studio by selecting the "Open a local folder" option, or:
- In a terminal, run:
cmake --preset debug-msvc -G "Visual Studio 17 2022"- Then you can open a file explorer in the
build/debug-msvcdirectory - Then open the .sln file, and you should be set!
Using MSVC without the Visual Studio IDE (i.e., Clion, VS Code)
- Make sure you have Ninja installed through something like chocolatey or winget
- In a terminal, run:
cmake --preset debug-msvccd build/debug-msvccmake --build .(Optionally append:--target editoror some other target)
- Or you can select the debug/release-msvc preset in your ide
Using MinGW
- Make sure basic MinGW packages are installed like libc++ and gcc
- In a terminal, run:
cmake --preset debug-mingw(orrelease-mingw)
- Or select the desired preset in your ide
I seldom test Linux on PopOS and Ubuntu (WSL), but note that I regularly use Windows and therefore windows is the most supported platform
-
Makefiles
- Just add the
-G "Unix Makefiles"command in all the following config command, otherwise Ninja is the default generator
- Just add the
-
Default Configuration
- The
debug-defaultandrelease defaultcommands should suffice - Run:
cmake --preset debug-defaultcd build/debug-defaultcmake --build .(Optionally append:--target editoror some other target)
- The
MacOS should have no problems and should follow the same config as Linux, but who knows. I have not tested MacOS builds.
Example usage: cmake --preset debug-default -DIS_MONLITHIC=ON
| Flag | Description | Default | Note | |
|---|---|---|---|---|
| IS_MONOLITHIC | Allows compiling moon_engine as a static library and linking projects statically | OFF | May require deleting the CMakeCache file in the build location |