diff options
author | Kenny Levinsen <kl@kl.wtf> | 2020-07-31 15:58:45 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2020-07-31 16:03:49 +0200 |
commit | 554898e6b32a3750f12834c5a07e9c27ef26c359 (patch) | |
tree | 7532ff648926dffe1198eb819b0ee60df3f7d15c /meson.build | |
parent | 85860e4e7ca18a246b7a862e3aa37bf3122f8baa (diff) |
meson: Set _FORTIFY_SOURCE=2 for optimized builds
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meson.build b/meson.build index be2c365..35e7460 100644 --- a/meson.build +++ b/meson.build @@ -23,13 +23,17 @@ add_project_arguments( '-Wmissing-prototypes', '-Wno-unknown-warning', '-Wvla', - '-D_XOPEN_SOURCE=9000', '-Wl,--exclude-libs=ALL', '-fvisibility=hidden', + '-D_XOPEN_SOURCE=700', ], language: 'c', ) +if ['debugoptimized', 'release', 'minsize'].contains(get_option('buildtype')) + add_project_arguments('-D_FORTIFY_SOURCE=2', language: 'c') +endif + # Hacks source_root = meson.current_source_dir().split('/') build_root = meson.build_root().split('/') |