diff options
author | Max Kellermann <max@musicpd.org> | 2021-05-25 20:49:27 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-05-25 21:08:06 +0200 |
commit | 48c7c540df7ae65eae099525c3e314d3035a2b5b (patch) | |
tree | dc8759ab5d3567915aabd91076bb54694c5b096f /meson.build | |
parent | 281270cd2ad1aa60968275cf62a9cc1dd1ce56f2 (diff) |
meson.build: use add_project_arguments() instead of add_global_arguments()
Don't propagate MPD-specific compiler flags to subprojects.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/meson.build b/meson.build index 526980bdc..2d921e764 100644 --- a/meson.build +++ b/meson.build @@ -42,16 +42,24 @@ common_cppflags = [ '-D_GNU_SOURCE', ] +test_global_common_flags = [ + '-fvisibility=hidden', +] + test_common_flags = [ '-Wvla', '-Wdouble-promotion', - '-fvisibility=hidden', - '-ffast-math', '-ftree-vectorize', ] +test_global_cxxflags = test_global_common_flags + [ +] + +test_global_cflags = test_global_common_flags + [ +] + test_cxxflags = test_common_flags + [ '-fno-threadsafe-statics', '-fmerge-all-constants', @@ -91,11 +99,11 @@ test_ldflags = [ ] if get_option('buildtype') != 'debug' - test_cxxflags += [ + test_global_cxxflags += [ '-ffunction-sections', '-fdata-sections', ] - test_cflags += [ + test_global_cflags += [ '-ffunction-sections', '-fdata-sections', ] @@ -114,9 +122,11 @@ if get_option('fuzzer') add_global_link_arguments(fuzzer_flags, language: 'cpp') endif -add_global_arguments(compiler.get_supported_arguments(test_cxxflags), language: 'cpp') -add_global_arguments(c_compiler.get_supported_arguments(test_cflags), language: 'c') -add_global_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp') +add_global_arguments(compiler.get_supported_arguments(test_global_cxxflags), language: 'cpp') +add_global_arguments(c_compiler.get_supported_arguments(test_global_cflags), language: 'c') +add_project_arguments(compiler.get_supported_arguments(test_cxxflags), language: 'cpp') +add_project_arguments(c_compiler.get_supported_arguments(test_cflags), language: 'c') +add_project_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp') is_linux = host_machine.system() == 'linux' is_android = get_option('android_ndk') != '' |