config clarification
This commit is contained in:
parent
357598c055
commit
846fe14573
1 changed files with 26 additions and 2 deletions
28
README.md
28
README.md
|
@ -267,8 +267,8 @@ ngen behaves. Right now, this only involves a single feature: generating a
|
||||||
compile\_commands.json file for the `clangd` LSP.
|
compile\_commands.json file for the `clangd` LSP.
|
||||||
|
|
||||||
To enable the generation of compile\_commands.json, simply add the following
|
To enable the generation of compile\_commands.json, simply add the following
|
||||||
line the **global scope** (i.e. next to your `main` target, not beneath any of
|
line to the **top** of your `ngen.toml` **(all `config` keys MUST be at the TOP
|
||||||
your other targets) of your `ngen.toml`:
|
of the file)**:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
config.compile_commands = true
|
config.compile_commands = true
|
||||||
|
@ -289,3 +289,27 @@ config.compile_commands_target = "debug"
|
||||||
|
|
||||||
will generate the the compile\_commands for the `debug` target.
|
will generate the the compile\_commands for the `debug` target.
|
||||||
|
|
||||||
|
Our final `ngen.toml` looks like this:
|
||||||
|
```toml
|
||||||
|
config.compile_commands = true
|
||||||
|
config.compile_commands_target = "debug"
|
||||||
|
|
||||||
|
outfile = "example"
|
||||||
|
compiler = "gcc"
|
||||||
|
compiler_flags = ["-Wall", "-Wextra"]
|
||||||
|
linker_libs = ["-lm"]
|
||||||
|
sources = [
|
||||||
|
"src/main.c",
|
||||||
|
"src/util.c",
|
||||||
|
"src/functions.c",
|
||||||
|
"src/foobar.c",
|
||||||
|
]
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
outfile = "example_dbg"
|
||||||
|
compiler_flags = ["-g"]
|
||||||
|
|
||||||
|
[release]
|
||||||
|
compiler_flags = ["-O2"]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue