summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
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')