config clarification

This commit is contained in:
Noah Swerhun 2024-03-06 13:54:08 -06:00
parent 357598c055
commit 846fe14573

View file

@ -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"]
```