From af5253bd4d053a924169ce1097e83790e3b6306a Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Tue, 24 Sep 2024 13:18:07 +0800 Subject: [PATCH] build: Update link flags for tests (cherry picked from commit fa936f883ae0e2a25deb2de2c8ee36f4c465f391) Signed-off-by: LIU Hao --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 4dd7f3fd3..6bae242e3 100644 --- a/meson.build +++ b/meson.build @@ -344,6 +344,7 @@ import('pkgconfig').generate(lib_mcfgthread_dll, foreach src: test_src test_c_args = [] test_cpp_args = [] + test_link_args = [] test_dependencies = [] test_link_with = lib_mcfgthread_dll @@ -372,10 +373,14 @@ foreach src: test_src test_cpp_args = [ '-std=c++11', '-Wpedantic' ] endif + if src.endswith('.cpp') + test_link_args = [ '-static-libgcc', '-static-libstdc++' ] + endif + test_exe = executable(src.underscorify(), src, c_args: test_c_args, cpp_args: test_cpp_args, - link_args: [ '-static-libgcc', '-static-libstdc++' ], + link_args: test_link_args, dependencies: test_dependencies, link_with: test_link_with, install: false)