From 4b6f2172be9eb9dbcac13cf3c5b9ece73fa0ac1f Mon Sep 17 00:00:00 2001 From: SergeyLebedkin Date: Fri, 8 Nov 2024 14:00:45 +0200 Subject: [PATCH] wg_engineL fix test build scripts and ambiguous declarations Issue https://github.com/thorvg/thorvg/issues/2938 --- examples/meson.build | 12 +++++++----- test/meson.build | 12 ++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/examples/meson.build b/examples/meson.build index bdc1eeb9..c1ac2176 100644 --- a/examples/meson.build +++ b/examples/meson.build @@ -1,9 +1,11 @@ +examples_compiler_flags = compiler_flags + if lib_type == 'static' - compiler_flags += ['-DTVG_STATIC'] + examples_compiler_flags += ['-DTVG_STATIC'] endif if target_opengles - compiler_flags += '-DTHORVG_GL_TARGET_GLES=1' + examples_compiler_flags += '-DTHORVG_GL_TARGET_GLES=1' endif examples_dep = [dependency('sdl2')] @@ -13,7 +15,7 @@ if all_engines or get_option('engines').contains('wg') if host_machine.system() == 'darwin' add_languages('objcpp') examples_dep += declare_dependency(link_args: ['-lobjc', '-framework', 'Cocoa', '-framework', 'CoreVideo', '-framework', 'IOKit', '-framework', 'QuartzCore']) - compiler_flags += ['-x', 'objective-c++'] + examples_compiler_flags += ['-x', 'objective-c++'] endif endif @@ -86,7 +88,7 @@ foreach current_file : source_file executable(name, current_file, include_directories : headers, link_with : thorvg_lib, - cpp_args : compiler_flags, + cpp_args : examples_compiler_flags, dependencies : examples_dep) endforeach @@ -101,7 +103,7 @@ if get_option('bindings').contains('capi') executable(name, current_file, include_directories : headers, link_with : thorvg_lib, - cpp_args : compiler_flags, + cpp_args : examples_compiler_flags, dependencies : examples_dep) endforeach endif diff --git a/test/meson.build b/test/meson.build index 0d89fcc1..32a292e7 100644 --- a/test/meson.build +++ b/test/meson.build @@ -1,5 +1,12 @@ +test_compiler_flags = compiler_flags + if lib_type == 'static' - compiler_flags += ['-DTVG_STATIC'] + test_compiler_flags += ['-DTVG_STATIC'] +endif + +test_dep = [] +if host_machine.system() == 'darwin' + test_dep += declare_dependency(link_args: ['-framework', 'Cocoa', '-framework', 'IOKit']) endif test_file = [ @@ -23,7 +30,8 @@ tests = executable('tvgUnitTests', test_file, include_directories : headers, link_with : thorvg_lib, - cpp_args : compiler_flags) + cpp_args : test_compiler_flags, + dependencies : test_dep) test('Unit Tests', tests, args : ['--success'])