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.
|
||||
|
||||
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
|
||||
your other targets) of your `ngen.toml`:
|
||||
line to the **top** of your `ngen.toml` **(all `config` keys MUST be at the TOP
|
||||
of the file)**:
|
||||
|
||||
```toml
|
||||
config.compile_commands = true
|
||||
|
@ -289,3 +289,27 @@ config.compile_commands_target = "debug"
|
|||
|
||||
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