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