From 554898e6b32a3750f12834c5a07e9c27ef26c359 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Fri, 31 Jul 2020 15:58:45 +0200 Subject: meson: Set _FORTIFY_SOURCE=2 for optimized builds --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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('/') -- cgit v1.2.3