more typos (i should proofread before i commit)

This commit is contained in:
Noah Swerhun 2024-03-06 14:18:36 -06:00
parent 846fe14573
commit 7f3dfe1506

View file

@ -39,7 +39,7 @@ Uninstall: `sudo sh uninstall.sh`
## Usage ## Usage
What follows is a tutorial of how to set up ngen for an existing executable What follows is a tutorial of how to set up ngen for an existing executable
project. If you are looking for a reference, look <SOMEWHERE>. project.
### Basics ### Basics
@ -170,8 +170,8 @@ these values will be automatically picked up by Ninja and accounted for in the
build. Running `ninja -v` immediately after saving `ngen.toml` should show that build. Running `ninja -v` immediately after saving `ngen.toml` should show that
the options you set were recognized, and your files were rebuilt accordingly. the options you set were recognized, and your files were rebuilt accordingly.
Now, this is a good start. But, it often the case that in a project, you want to Now, this is a good start. But, it often the case that, in a project, you want
have multiple different build *targets,* or configurations, that build the to have multiple different build *targets,* or configurations, that build the
project with slightly different parameters; for example, it is common to have a project with slightly different parameters; for example, it is common to have a
"debug" build target that is unoptimized and includes debugging symbols, and a "debug" build target that is unoptimized and includes debugging symbols, and a
"release" build that is optimized at compile time. ngen is designed to make this "release" build that is optimized at compile time. ngen is designed to make this
@ -202,7 +202,7 @@ according to two simple rules: **a**rrays **a**ppend, **s**trings **s**upercede.
The first thing that happens is `debug` takes on all the same parameters from The first thing that happens is `debug` takes on all the same parameters from
main. Then, ngen reads the outfile key in `debug`. Becuase outfile is a string, main. Then, ngen reads the outfile key in `debug`. Becuase outfile is a string,
`debug.outfile` is overwritten as the value specified, in this case `debug.outfile` is overwritten as the value specified, in this case
"example\_dbg". On the othe hand, since compiler\_flags is a list, the elements "example\_dbg". On the other hand, since compiler\_flags is a list, the elements
sepecified in `debug.compiler_flags` are appended to the list of flags specified sepecified in `debug.compiler_flags` are appended to the list of flags specified
in `main`. So in this case, the effective value of `debug.compiler_flags` is in `main`. So in this case, the effective value of `debug.compiler_flags` is
`["-Wall", "-Wextra -O2", "-g"]`. `["-Wall", "-Wextra -O2", "-g"]`.
@ -237,8 +237,8 @@ your `ngen.toml`: the special `main` target should only contain the largest
subset of all your build parameters. Additonal targets should add specific subset of all your build parameters. Additonal targets should add specific
parameters for specific use cases, as we saw in the above example. parameters for specific use cases, as we saw in the above example.
In a nutshell, inheritance allows you to easily create multiple targets with small variations, In a nutshell, inheritance allows you to easily create multiple targets with
without having to rewrite the same thing over and over again. small variations, without having to rewrite the same thing over and over again.
Save `ngen.toml`, and try running `ninja -v debug` or `ninja -v release`. You Save `ngen.toml`, and try running `ninja -v debug` or `ninja -v release`. You
should see that each of these targets uses the parameters that we specified with should see that each of these targets uses the parameters that we specified with
@ -280,7 +280,7 @@ make sure that this file is kept up to date as well. Just set the option in your
ngen.toml and forget about it. ngen.toml and forget about it.
By default, the compile\_commands.json will be generated according to the build By default, the compile\_commands.json will be generated according to the build
specs of the `main` target. To change which target it is generated for use the specs of the `main` target. To change which target it is generated, for use the
`config.compile_commands_target` key. For example, `config.compile_commands_target` key. For example,
```toml ```toml
@ -308,6 +308,7 @@ sources = [
[debug] [debug]
outfile = "example_dbg" outfile = "example_dbg"
compiler_flags = ["-g"] compiler_flags = ["-g"]
default = true
[release] [release]
compiler_flags = ["-O2"] compiler_flags = ["-O2"]