summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meson.build7
1 files changed, 7 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 503180ed..a05e912c 100644
--- a/meson.build
+++ b/meson.build
@@ -256,6 +256,13 @@ config.set10('HAVE_MEMFD_CREATE', have)
add_project_arguments('-D_GNU_SOURCE', language : 'c')
add_project_arguments('-include', 'config.h', language : 'c')
+# FEATURE_TEST_MACROS(7)
+# performs lightweight overflow checks on quite a few libc functions
+# requires -O optimizations
+if ['debugoptimized', 'release', 'minsize'].contains(get_option('buildtype'))
+ add_project_arguments('-D_FORTIFY_SOURCE=2', language : 'c')
+endif
+
config.set('PACKAGE_NAME', meson.project_name())
config.set_quoted('PACKAGE_VERSION', meson.project_version())
config.set_quoted('PACKAGE', meson.project_name())