Commit 48c7c540 authored by Max Kellermann's avatar Max Kellermann

meson.build: use add_project_arguments() instead of add_global_arguments()

Don't propagate MPD-specific compiler flags to subprojects.
parent 281270cd
...@@ -42,16 +42,24 @@ common_cppflags = [ ...@@ -42,16 +42,24 @@ common_cppflags = [
'-D_GNU_SOURCE', '-D_GNU_SOURCE',
] ]
test_global_common_flags = [
'-fvisibility=hidden',
]
test_common_flags = [ test_common_flags = [
'-Wvla', '-Wvla',
'-Wdouble-promotion', '-Wdouble-promotion',
'-fvisibility=hidden',
'-ffast-math', '-ffast-math',
'-ftree-vectorize', '-ftree-vectorize',
] ]
test_global_cxxflags = test_global_common_flags + [
]
test_global_cflags = test_global_common_flags + [
]
test_cxxflags = test_common_flags + [ test_cxxflags = test_common_flags + [
'-fno-threadsafe-statics', '-fno-threadsafe-statics',
'-fmerge-all-constants', '-fmerge-all-constants',
...@@ -91,11 +99,11 @@ test_ldflags = [ ...@@ -91,11 +99,11 @@ test_ldflags = [
] ]
if get_option('buildtype') != 'debug' if get_option('buildtype') != 'debug'
test_cxxflags += [ test_global_cxxflags += [
'-ffunction-sections', '-ffunction-sections',
'-fdata-sections', '-fdata-sections',
] ]
test_cflags += [ test_global_cflags += [
'-ffunction-sections', '-ffunction-sections',
'-fdata-sections', '-fdata-sections',
] ]
...@@ -114,9 +122,11 @@ if get_option('fuzzer') ...@@ -114,9 +122,11 @@ if get_option('fuzzer')
add_global_link_arguments(fuzzer_flags, language: 'cpp') add_global_link_arguments(fuzzer_flags, language: 'cpp')
endif endif
add_global_arguments(compiler.get_supported_arguments(test_cxxflags), language: 'cpp') add_global_arguments(compiler.get_supported_arguments(test_global_cxxflags), language: 'cpp')
add_global_arguments(c_compiler.get_supported_arguments(test_cflags), language: 'c') add_global_arguments(c_compiler.get_supported_arguments(test_global_cflags), language: 'c')
add_global_link_arguments(compiler.get_supported_link_arguments(test_ldflags), language: 'cpp') 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_linux = host_machine.system() == 'linux'
is_android = get_option('android_ndk') != '' is_android = get_option('android_ndk') != ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment