summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-08-15 19:12:49 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2021-08-15 19:12:49 +0100
commit8ee4d5f1d346c4933fed993ca3b132b4952c432d (patch)
tree97253952f6a9fd7ac6e339f80484a44037adcea9 /meson.build
parent8b5e285e26ca126a5ae40211bda074fe460a0614 (diff)
downloadcairo-8ee4d5f1d346c4933fed993ca3b132b4952c432d.tar.gz
meson: Enable _FORTIFY_SOURCE for optimized builds
Otherwise we are going to get warnings from the C library.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build4
1 files changed, 3 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 2f618f75c..f10a0067b 100644
--- a/meson.build
+++ b/meson.build
@@ -70,7 +70,9 @@ if cc.get_id() != 'msvc'
'-fno-common'
]
- cflags += '-Wp,-D_FORTIFY_SOURCE=2'
+ if get_option('optimization') in ['1', '2', '3']
+ cflags += '-Wp,-D_FORTIFY_SOURCE=2'
+ endif
supported_cflags = cc.get_supported_arguments(cflags)
add_project_arguments(supported_cflags, language: 'c')