summaryrefslogtreecommitdiffstats
path: root/test cases/common/209 link custom_i single from multiple/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common/209 link custom_i single from multiple/meson.build')
-rw-r--r--test cases/common/209 link custom_i single from multiple/meson.build42
1 files changed, 42 insertions, 0 deletions
diff --git a/test cases/common/209 link custom_i single from multiple/meson.build b/test cases/common/209 link custom_i single from multiple/meson.build
new file mode 100644
index 0000000..7aadb17
--- /dev/null
+++ b/test cases/common/209 link custom_i single from multiple/meson.build
@@ -0,0 +1,42 @@
+project('linkcustom', 'c')
+
+# This would require passing the static linker to the build script or having
+# it detect it by itself. I'm too lazy to implement it now and it is not
+# really needed for testing that custom targets work. It is the responsibility
+# of the custom target to produce things in the correct format.
+assert(not meson.is_cross_build(),
+ 'MESON_SKIP_TEST cross checking not implemented.')
+
+cc = meson.get_compiler('c')
+genprog = find_program('generate_conflicting_stlibs.py')
+
+clib = custom_target('linkcustom',
+ output: ['libflob_1.a', 'libflob_2.a'],
+ command: [genprog,
+ '-o', '@OUTPUT@',
+ '--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array())
+
+clib_2 = clib[1]
+
+exe = executable('prog', 'prog.c', link_with: clib_2)
+test('linkcustom', exe)
+
+d = declare_dependency(link_with: clib_2)
+
+exe2 = executable('prog2', 'prog.c', dependencies: d)
+test('linkcustom2', exe2)
+
+# Link whole tests
+
+if meson.backend() == 'xcode'
+ message('Xcode does not support link whole so skipping.')
+ subdir_done()
+endif
+
+exe3 = executable('prog3', 'prog.c', link_whole: clib_2)
+test('linkwhole', exe)
+
+d2 = declare_dependency(link_whole: clib_2)
+
+exe4 = executable('prog4', 'prog.c', dependencies: d2)
+test('linkwhole2', exe2)