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/d.py | |
parent | e945f35cd72402d0d204ff10870e2a95c59b6192 (diff) | |
download | meson-a590cfde0cf719c637b75e4784be0c0ae60e3b1f.zip meson-a590cfde0cf719c637b75e4784be0c0ae60e3b1f.tar.gz meson-a590cfde0cf719c637b75e4784be0c0ae60e3b1f.tar.bz2 |
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/d.py')
-rw-r--r-- | mesonbuild/compilers/d.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index 54f0d9a..fbdf288 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -66,7 +66,8 @@ d_feature_args = {'gcc': {'unittest': '-funittest', } } # type: T.Dict[str, T.Dict[str, str]] -ldc_optimization_args = {'0': [], +ldc_optimization_args = {'plain': [], + '0': [], 'g': [], '1': ['-O1'], '2': ['-O2'], @@ -74,7 +75,8 @@ ldc_optimization_args = {'0': [], 's': ['-Oz'], } # type: T.Dict[str, T.List[str]] -dmd_optimization_args = {'0': [], +dmd_optimization_args = {'plain': [], + '0': [], 'g': [], '1': ['-O'], '2': ['-O'], |