aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
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 /docs/markdown/snippets
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 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/add_optimization_plain_option.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/snippets/add_optimization_plain_option.md b/docs/markdown/snippets/add_optimization_plain_option.md
new file mode 100644
index 0000000..67910df
--- /dev/null
+++ b/docs/markdown/snippets/add_optimization_plain_option.md
@@ -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.