Files
vcmi/docs/developers/CMake.md
T

21 lines
757 B
Markdown
Raw Normal View History

# CMake options
* `-D CMAKE_BUILD_TYPE=Debug`
2024-11-30 20:20:15 +00:00
* Enables debug info and disables optimizations
* `-D CMAKE_EXPORT_COMPILE_COMMANDS=ON`
2024-11-30 20:20:15 +00:00
* Creates `compile_commands.json` for [clangd](https://clangd.llvm.org/) language server. For clangd to find the JSON, create a file named `.clangd` with this content
```text
2024-11-30 20:20:15 +00:00
CompileFlags:
CompilationDatabase: build
```
and place it here:
```text
2024-11-30 20:20:15 +00:00
.
├── vcmi -> contains sources and is under git control
├── build -> contains build output, makefiles, object files,...
└── .clangd
```
* `-D ENABLE_CCACHE:BOOL=ON`
2024-11-30 20:20:15 +00:00
* Speeds up recompilation
* `-G Ninja`
2024-11-30 20:20:15 +00:00
* Use Ninja build system instead of Make, which speeds up the build and doesn't require a `-j` flag