Add declare_dependency() test for link_whole

pull/3086/head
Aleksey Filippov 7 years ago
parent 077d59daa4
commit cd245eccbd
  1. 1
      test cases/common/145 whole archive/exe3/meson.build
  2. 9
      test cases/common/145 whole archive/meson.build
  3. 4
      test cases/common/145 whole archive/sh_func2_dep_func1/meson.build

@ -0,0 +1 @@
exe3 = executable('prog3', '../prog.c', link_with : sh_func2_dep_func1)

@ -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)

@ -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)
Loading…
Cancel
Save