summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-06-08 09:23:50 +0900
committerLennart Poettering <lennart@poettering.net>2021-06-08 10:44:34 +0200
commit16e09d51a7f5f688d5b699806f6f092f590d2e0d (patch)
tree9b74a10f3d5f6876723f0ff63bbaafbefae98dec /meson.build
parent9f40351f77963efc304473830a431c424fd976b1 (diff)
downloadsystemd-16e09d51a7f5f688d5b699806f6f092f590d2e0d.tar.gz
meson: do not share compiler flags except for emitting warnings
Follow-up for 65267363978dbb298eb4ba9b628d028c969fa616. Prompted by https://github.com/systemd/systemd/issues/19191#issuecomment-856312107.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build29
1 files changed, 14 insertions, 15 deletions
diff --git a/meson.build b/meson.build
index 8a83a4e268..a90c9b89e5 100644
--- a/meson.build
+++ b/meson.build
@@ -355,13 +355,6 @@ possible_common_cc_flags = [
# negative arguments are correctly detected starting with meson 0.46.
'-Wno-error=#warnings', # clang
'-Wno-string-plus-int', # clang
-
- '-ffast-math',
- '-fno-common',
- '-fdiagnostics-show-option',
- '-fno-strict-aliasing',
- '-fvisibility=hidden',
- '--param=ssp-buffer-size=4',
]
# Disable -Wmaybe-unitialized when compiling with -Os/-O1/-O3/etc. There are
@@ -388,8 +381,21 @@ if cc.get_id() == 'clang'
]
endif
+possible_cc_flags = possible_common_cc_flags + [
+ '-Werror=missing-declarations',
+ '-Werror=missing-prototypes',
+ '-fdiagnostics-show-option',
+ '-ffast-math',
+ '-fno-common',
+ '-fno-strict-aliasing',
+ '-fstack-protector',
+ '-fstack-protector-strong',
+ '-fvisibility=hidden',
+ '--param=ssp-buffer-size=4',
+]
+
if get_option('buildtype') != 'debug'
- possible_common_cc_flags += [
+ possible_cc_flags += [
'-ffunction-sections',
'-fdata-sections',
]
@@ -397,13 +403,6 @@ if get_option('buildtype') != 'debug'
possible_link_flags += '-Wl,--gc-sections'
endif
-possible_cc_flags = possible_common_cc_flags + [
- '-Werror=missing-declarations',
- '-Werror=missing-prototypes',
- '-fstack-protector',
- '-fstack-protector-strong',
-]
-
add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')