diff --git a/README.md b/README.md index 3857a4f..8d642b4 100644 --- a/README.md +++ b/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"] +``` +