diff options
author | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
---|---|---|
committer | Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com> | 2023-10-10 14:33:42 +0000 |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/common/137 whole archive/meson.build | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/common/137 whole archive/meson.build')
-rw-r--r-- | meson/test cases/common/137 whole archive/meson.build | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/meson/test cases/common/137 whole archive/meson.build b/meson/test cases/common/137 whole archive/meson.build new file mode 100644 index 000000000..d4cbb832c --- /dev/null +++ b/meson/test cases/common/137 whole archive/meson.build @@ -0,0 +1,49 @@ +project('whole archive', 'c') + +if meson.backend() == 'xcode' or \ + meson.backend() == 'vs2010' or \ + meson.backend() == 'vs2012' or \ + meson.backend() == 'vs2013' + error('MESON_SKIP_TEST: whole-archive not supported in Xcode nor pre-VS2015 IDE. Patches welcome.') +endif + +add_project_arguments('-I' + meson.source_root(), language : 'c') + +# Test 1: link_whole keeps all symbols +# Make static func1 +subdir('st_func1') +# Make shared func2 linking whole func1 archive +subdir('sh_func2_linked_func1') +# Link exe with shared library only +subdir('exe') +# Test that both func1 and func2 are accessible from shared library +test('prog', exe) + +# Test 2: link_whole can be used instead of source list, see #2180 +# Make static func2 +subdir('st_func2') +# Link both func1 and func2 into same shared library +# which does not have any sources other than 2 static libraries +subdir('sh_only_link_whole') +# Link exe2 with shared library only +subdir('exe2') +# Test that both func1 and func2 are accessible from shared library +test('prog2', exe2) + +# Test 3: link_whole can be used in declare_dependency() +func1_dep = declare_dependency(link_whole : [st_func1]) +# Use dependency to link func1 into shared library +subdir('sh_func2_dep_func1') +# Link exe3 with shared library +subdir('exe3') +# Test that both func1 and func2 are accessible from shared library +test('prog3', exe3) + +# Test 4: link_whole can be used in transitive declare_dependency() +func1_trans_dep = declare_dependency(dependencies : func1_dep) +# Use transitive dependency to link func1 into shared library +subdir('sh_func2_transdep_func1') +# Link exe4 with shared library +subdir('exe4') +# Test that both func1 and func2 are accessible from shared library +test('prog4', exe4) |