From a590cfde0cf719c637b75e4784be0c0ae60e3b1f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 12 Jul 2022 15:22:30 +0200 Subject: compilers: Add optimization=plain option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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`. --- mesonbuild/compilers/cs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mesonbuild/compilers/cs.py') diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index 9690cdb..64cca96 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -28,7 +28,9 @@ if T.TYPE_CHECKING: from ..environment import Environment from ..mesonlib import MachineChoice -cs_optimization_args = {'0': [], +cs_optimization_args = { + 'plain': [], + '0': [], 'g': [], '1': ['-optimize+'], '2': ['-optimize+'], -- cgit v1.1