aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2022-07-12 15:22:30 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2022-10-09 14:43:18 +0300
commita590cfde0cf719c637b75e4784be0c0ae60e3b1f (patch)
tree3287d2c965962c470d027ead3df8256da000ec62 /mesonbuild/compilers/compilers.py
parente945f35cd72402d0d204ff10870e2a95c59b6192 (diff)
downloadmeson-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/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 725d394..ea03869 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -254,7 +254,8 @@ msvc_winlibs = ['kernel32.lib', 'user32.lib', 'gdi32.lib',
'winspool.lib', 'shell32.lib', 'ole32.lib', 'oleaut32.lib',
'uuid.lib', 'comdlg32.lib', 'advapi32.lib'] # type: T.List[str]
-clike_optimization_args = {'0': [],
+clike_optimization_args = {'plain': [],
+ '0': [],
'g': [],
'1': ['-O1'],
'2': ['-O2'],
@@ -262,7 +263,8 @@ clike_optimization_args = {'0': [],
's': ['-Os'],
} # type: T.Dict[str, T.List[str]]
-cuda_optimization_args = {'0': [],
+cuda_optimization_args = {'plain': [],
+ '0': [],
'g': ['-O0'],
'1': ['-O1'],
'2': ['-O2'],