diff options
| author | Jan Tojnar <jtojnar@gmail.com> | 2022-07-12 15:22:30 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-10-09 14:43:18 +0300 |
| commit | a590cfde0cf719c637b75e4784be0c0ae60e3b1f (patch) | |
| tree | 3287d2c965962c470d027ead3df8256da000ec62 /mesonbuild/compilers/rust.py | |
| parent | e945f35cd72402d0d204ff10870e2a95c59b6192 (diff) | |
| download | meson-a590cfde0cf719c637b75e4784be0c0ae60e3b1f.tar.gz | |
compilers: Add optimization=plain option
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`.
Diffstat (limited to 'mesonbuild/compilers/rust.py')
| -rw-r--r-- | mesonbuild/compilers/rust.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index a7bab0f4b..745682315 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -31,6 +31,7 @@ if T.TYPE_CHECKING: rust_optimization_args = { + 'plain': [], '0': [], 'g': ['-C', 'opt-level=0'], '1': ['-C', 'opt-level=1'], |
