mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Remove .clangd config and add separate markdown file explaining some CMake options
This commit is contained in:
parent
97c9cd483b
commit
775b20bfe2
@ -52,7 +52,7 @@ We recommend the following directory structure:
|
||||
```
|
||||
.
|
||||
├── vcmi -> contains sources and is under git control
|
||||
└── vcmi-build -> contains build output, makefiles, object files,...
|
||||
└── build -> contains build output, makefiles, object files,...
|
||||
```
|
||||
|
||||
You can get the latest source code with:
|
||||
@ -64,22 +64,16 @@ You can get the latest source code with:
|
||||
## Configuring Makefiles
|
||||
|
||||
```sh
|
||||
mkdir vcmi-build
|
||||
cd vcmi-build
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -S ../vcmi
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The `../vcmi` is not a typo, it will place Makefiles into the build dir as the build dir is your working dir when calling CMake.
|
||||
|
||||
### Additional options that you may want to use:
|
||||
See [CMake](CMake.md) for a list of options
|
||||
|
||||
| Option | Effect |
|
||||
|--------|--------|
|
||||
| -D CMAKE_BUILD_TYPE=Debug | Debug info and no optimizations |
|
||||
| -D ENABLE_CCACHE:BOOL=ON | Speeds up recompilation |
|
||||
| -D CMAKE_EXPORT_COMPILE_COMMANDS=ON | Creates `compile_commands.json` for `clangd` language server |
|
||||
| -G Ninja | Use Ninja build system instead of make, which speeds up the build and doesn't require a `-j` flag |
|
||||
|
||||
## Building
|
||||
|
||||
|
37
docs/developers/CMake.md
Normal file
37
docs/developers/CMake.md
Normal file
@ -0,0 +1,37 @@
|
||||
# CMake options
|
||||
|
||||
<!-- Pure markdown doesn't support code blocks within tables -->
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Option</th>
|
||||
<th>Effect</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>-D CMAKE_BUILD_TYPE=Debug</td>
|
||||
<td>Enables debug info and disables optimizations</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-D CMAKE_EXPORT_COMPILE_COMMANDS=ON</td>
|
||||
<td>Creates <code>compile_commands.json</code> for <a href="https://clangd.llvm.org/"><code>clangd</code></a> language server
|
||||
<br><br>
|
||||
For clangd to find the JSON, create a file named <code>.clangd</code>
|
||||
<pre>.
|
||||
├── vcmi -> contains sources and is under git control
|
||||
├── build -> contains build output, makefiles, object files,...
|
||||
└── .clangd</pre>
|
||||
with the following content
|
||||
<pre>CompileFlags:<br> CompilationDatabase: build</pre></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-D ENABLE_CCACHE:BOOL=ON</td>
|
||||
<td>Speeds up recompilation</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>-G Ninja</td>
|
||||
<td>Use Ninja build system instead of make, which speeds up the build and doesn't require a <code>-j</code> flag</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
Loading…
x
Reference in New Issue
Block a user