https://github.com/mesonbuild/meson/pull/9287 changed the `optimization=0` to pass `-O0` to the compiler. This change is reasonable by itself but unfortunately, it breaks `buildtype=plain`, which promises that “no extra build flags are used”. `buildtype=plain` is important for distros like NixOS, which manage compiler flags for optimization and hardening themselves. Let’s introduce a new optimization level that does nothing and set it as the default for `buildtype=plain`.pull/8176/head
parent
e945f35cd7
commit
a590cfde0c
19 changed files with 63 additions and 32 deletions
@ -0,0 +1,10 @@ |
||||
## Add `optimization` `plain` option |
||||
|
||||
The `optimization` built-in option now accepts `plain` value, |
||||
which will not set any optimization flags. This is now the default |
||||
value of the flag for `buildtype=plain`, which is useful for distros, |
||||
that set the optimization and hardening flags by other means. |
||||
|
||||
If you are using the value of `get_option('optimization')` in your |
||||
Meson scripts, make sure you are not making assumptions about it, |
||||
such as that the value can be passed to a compiler in `-O` flag. |
@ -1,5 +1,5 @@ |
||||
{ |
||||
"stdout": [ |
||||
{ "line": "test cases/failing/101 number in combo/meson.build:1:0: ERROR: Value \"1\" (of type \"number\") for combo option \"Optimization level\" is not one of the choices. Possible choices are (as string): \"0\", \"g\", \"1\", \"2\", \"3\", \"s\"." } |
||||
{ "line": "test cases/failing/101 number in combo/meson.build:1:0: ERROR: Value \"1\" (of type \"number\") for combo option \"Optimization level\" is not one of the choices. Possible choices are (as string): \"plain\", \"0\", \"g\", \"1\", \"2\", \"3\", \"s\"." } |
||||
] |
||||
} |
||||
|
Loading…
Reference in new issue