From 48c7c540df7ae65eae099525c3e314d3035a2b5b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 25 May 2021 20:49:27 +0200 Subject: [PATCH] meson.build: use add_project_arguments() instead of add_global_arguments() Don't propagate MPD-specific compiler flags to subprojects. --- meson.build | 24 +++++++++++++++++------- 1 file 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') != ''