add test case for #6365

pull/7827/head
Sahnvour 4 years ago committed by Nirbheek Chauhan
parent 206e9e5097
commit f80dcb4f33
  1. 6
      test cases/common/215 link custom/custom_target.c
  2. 6
      test cases/common/215 link custom/custom_target.py
  3. 1
      test cases/common/215 link custom/dummy.c
  4. 19
      test cases/common/215 link custom/meson.build
  5. 3
      test cases/common/215 link custom/outerlib.c

@ -0,0 +1,6 @@
void outer_lib_func(void);
int main(void) {
outer_lib_func();
return 0;
}

@ -0,0 +1,6 @@
#!/usr/bin/env python3
import shutil, sys
if __name__ == '__main__':
shutil.copyfile(sys.argv[1], sys.argv[2])

@ -0,0 +1 @@
void inner_lib_func(void) {}

@ -57,3 +57,22 @@ d2_i = declare_dependency(link_whole: clib[0])
exe4_i = executable('prog4_i', 'prog.c', dependencies: d2_i)
test('linkwhole2_i', exe2_i)
# Link with custom target
dummy = static_library('dummy', 'dummy.c')
custom_prog = find_program('custom_target.py')
t = custom_target('custom', input: dummy, output: 'libcustom.a', command: [custom_prog, '@INPUT@', '@OUTPUT@'])
dep1 = declare_dependency(link_with: t)
dep2 = declare_dependency(link_with: t[0])
lib1 = static_library('lib1', 'outerlib.c', dependencies: dep1)
lib2 = static_library('lib2', 'outerlib.c', dependencies: dep2)
exe1 = executable('exe1', 'custom_target.c', link_with: lib1)
test('custom_target_1', exe1)
exe1_2 = executable('exe1_2', 'custom_target.c', link_with: lib2)
test('custom_target_2', exe2)

@ -0,0 +1,3 @@
void inner_lib_func(void);
void outer_lib_func(void) { inner_lib_func(); }
Loading…
Cancel
Save