aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-07-31 15:58:45 +0200
committerKenny Levinsen <kl@kl.wtf>2020-07-31 16:03:49 +0200
commit554898e6b32a3750f12834c5a07e9c27ef26c359 (patch)
tree7532ff648926dffe1198eb819b0ee60df3f7d15c /meson.build
parent85860e4e7ca18a246b7a862e3aa37bf3122f8baa (diff)
meson: Set _FORTIFY_SOURCE=2 for optimized builds
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build6
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('/')