diff options
author | Aleksey Filippov <alekseyf@google.com> | 2018-02-18 08:16:23 +0000 |
---|---|---|
committer | Aleksey Filippov <alekseyf@google.com> | 2018-03-06 01:44:26 +0000 |
commit | 9f1d4c0dbe5556ea7a23648350a2d2f674d89cac (patch) | |
tree | 05841a002470e07bbba605d0eb580d4c08caadc8 | |
parent | cd245eccbdf3b5b999055fd72ff942f1327ec54d (diff) | |
download | meson-9f1d4c0dbe5556ea7a23648350a2d2f674d89cac.zip meson-9f1d4c0dbe5556ea7a23648350a2d2f674d89cac.tar.gz meson-9f1d4c0dbe5556ea7a23648350a2d2f674d89cac.tar.bz2 |
Add declare_dependency() test for transitive link_whole
3 files changed, 16 insertions, 0 deletions
diff --git a/test cases/common/145 whole archive/exe4/meson.build b/test cases/common/145 whole archive/exe4/meson.build new file mode 100644 index 0000000..0781250 --- /dev/null +++ b/test cases/common/145 whole archive/exe4/meson.build @@ -0,0 +1 @@ +exe4 = executable('prog4', '../prog.c', link_with : sh_func2_transdep_func1) diff --git a/test cases/common/145 whole archive/meson.build b/test cases/common/145 whole archive/meson.build index d5d5ed2..012df33 100644 --- a/test cases/common/145 whole archive/meson.build +++ b/test cases/common/145 whole archive/meson.build @@ -39,3 +39,12 @@ subdir('sh_func2_dep_func1') 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) diff --git a/test cases/common/145 whole archive/sh_func2_transdep_func1/meson.build b/test cases/common/145 whole archive/sh_func2_transdep_func1/meson.build new file mode 100644 index 0000000..0703077 --- /dev/null +++ b/test cases/common/145 whole archive/sh_func2_transdep_func1/meson.build @@ -0,0 +1,6 @@ +# Same as sh_func2_dep_func1 but dependency is transitive. +# func2.c does not have any reference to func1() so without link_whole compiler +# should throw func1() out. +sh_func2_transdep_func1 = shared_library( + 'sh_func2_transdep_func1', '../func2.c', + dependencies : func1_trans_dep) |