aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/215 link custom/custom_target.c6
-rw-r--r--test cases/common/215 link custom/custom_target.py6
-rw-r--r--test cases/common/215 link custom/dummy.c1
-rw-r--r--test cases/common/215 link custom/meson.build19
-rw-r--r--test cases/common/215 link custom/outerlib.c3
5 files changed, 35 insertions, 0 deletions
diff --git a/test cases/common/215 link custom/custom_target.c b/test cases/common/215 link custom/custom_target.c
new file mode 100644
index 0000000..1bbe82c
--- /dev/null
+++ b/test cases/common/215 link custom/custom_target.c
@@ -0,0 +1,6 @@
+void outer_lib_func(void);
+
+int main(void) {
+ outer_lib_func();
+ return 0;
+}
diff --git a/test cases/common/215 link custom/custom_target.py b/test cases/common/215 link custom/custom_target.py
new file mode 100644
index 0000000..c246344
--- /dev/null
+++ b/test cases/common/215 link custom/custom_target.py
@@ -0,0 +1,6 @@
+#!/usr/bin/env python3
+
+import shutil, sys
+
+if __name__ == '__main__':
+ shutil.copyfile(sys.argv[1], sys.argv[2])
diff --git a/test cases/common/215 link custom/dummy.c b/test cases/common/215 link custom/dummy.c
new file mode 100644
index 0000000..53a4a40
--- /dev/null
+++ b/test cases/common/215 link custom/dummy.c
@@ -0,0 +1 @@
+void inner_lib_func(void) {} \ No newline at end of file
diff --git a/test cases/common/215 link custom/meson.build b/test cases/common/215 link custom/meson.build
index 013da04..837e960 100644
--- a/test cases/common/215 link custom/meson.build
+++ b/test cases/common/215 link custom/meson.build
@@ -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) \ No newline at end of file
diff --git a/test cases/common/215 link custom/outerlib.c b/test cases/common/215 link custom/outerlib.c
new file mode 100644
index 0000000..6861f8d
--- /dev/null
+++ b/test cases/common/215 link custom/outerlib.c
@@ -0,0 +1,3 @@
+void inner_lib_func(void);
+
+void outer_lib_func(void) { inner_lib_func(); } \ No newline at end of file