diff options
author | Aleksey Filippov <alekseyf@google.com> | 2018-02-18 07:58:21 +0000 |
---|---|---|
committer | Aleksey Filippov <alekseyf@google.com> | 2018-03-06 01:44:26 +0000 |
commit | cd245eccbdf3b5b999055fd72ff942f1327ec54d (patch) | |
tree | 13055dca2afd8a98379b72288c79b65665cdd829 | |
parent | 077d59daa4593ae6586eeaafb53713907c7180db (diff) | |
download | meson-cd245eccbdf3b5b999055fd72ff942f1327ec54d.zip meson-cd245eccbdf3b5b999055fd72ff942f1327ec54d.tar.gz meson-cd245eccbdf3b5b999055fd72ff942f1327ec54d.tar.bz2 |
Add declare_dependency() test for link_whole
3 files changed, 14 insertions, 0 deletions
diff --git a/test cases/common/145 whole archive/exe3/meson.build b/test cases/common/145 whole archive/exe3/meson.build new file mode 100644 index 0000000..82cf57e --- /dev/null +++ b/test cases/common/145 whole archive/exe3/meson.build @@ -0,0 +1 @@ +exe3 = executable('prog3', '../prog.c', link_with : sh_func2_dep_func1) diff --git a/test cases/common/145 whole archive/meson.build b/test cases/common/145 whole archive/meson.build index 56da157..d5d5ed2 100644 --- a/test cases/common/145 whole archive/meson.build +++ b/test cases/common/145 whole archive/meson.build @@ -30,3 +30,12 @@ subdir('sh_only_link_whole') 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) diff --git a/test cases/common/145 whole archive/sh_func2_dep_func1/meson.build b/test cases/common/145 whole archive/sh_func2_dep_func1/meson.build new file mode 100644 index 0000000..92baca6 --- /dev/null +++ b/test cases/common/145 whole archive/sh_func2_dep_func1/meson.build @@ -0,0 +1,4 @@ +# Same as sh_func2_linked_func1, # func2.c does not depend on func1(), +# so without link_whole compiler would throw func1() away. +# This is the same version of the test with a dependency object instead. +sh_func2_dep_func1 = shared_library('sh_func2_dep_func1', '../func2.c', dependencies : func1_dep) |