Skip to content

Commit

Permalink
Document the details of optimization+debug vs buildtype [skip ci]
Browse files Browse the repository at this point in the history
Otherwise you have to hunt through the source code. Specifically, this
is defined in `mesonbuild/coredata.py`: `set_buildtype_from_others()`
and `set_others_from_buildtype()`
  • Loading branch information
nirbheek committed Mar 4, 2020
1 parent 1210a67 commit 5c14f98
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/markdown/Builtin-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ Using the option as-is with no prefix affects all machines. For example:
| werror | false | Treat warnings as errors | no |
| wrap_mode {default, nofallback,<br>nodownload, forcefallback} | default | Wrap mode to use | no |

For setting optimization levels and toggling debug, you can either set the
`buildtype` option, or you can set the `optimization` and `debug` options which
give finer control over the same. Whichever you decide to use, the other will
be deduced from it. For example, `-Dbuildtype=debugoptimized` is the same as
`-Ddebug=true -Doptimization=2` and vice-versa. This table documents the
two-way mapping:

| buildtype | debug | optimization |
| --------- | ----- | ------------ |
| plain | false | 0 |
| debug | true | 0 |
| debugoptimized | true | 2 |
| release | false | 3 |
| minsize | true | s |

All other combinations of `debug` and `optimization` set `buildtype` to `'custom'`.

## Base options

These are set in the same way as universal options, but cannot be shown in the
Expand Down

0 comments on commit 5c14f98

Please sign in to comment.