1
project('linkcustom', 'c')
3
# This would require passing the static linker to the build script or having
4
# it detect it by itself. I'm too lazy to implement it now and it is not
5
# really needed for testing that custom targets work. It is the responsibility
6
# of the custom target to produce things in the correct format.
7
assert(not meson.is_cross_build(),
8
'MESON_SKIP_TEST cross checking not implemented.')
10
cc = meson.get_compiler('c')
11
genprog = find_program('generate_conflicting_stlibs.py')
13
clib = custom_target('linkcustom',
14
output: ['libflob_1.a', 'libflob_2.a'],
17
'--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array())
21
exe = executable('prog', 'prog.c', link_with: clib_2)
22
test('linkcustom', exe)
24
d = declare_dependency(link_with: clib_2)
26
exe2 = executable('prog2', 'prog.c', dependencies: d)
27
test('linkcustom2', exe2)
31
exe3 = executable('prog3', 'prog.c', link_whole: clib_2)
32
test('linkwhole', exe)
34
d2 = declare_dependency(link_whole: clib_2)
36
exe4 = executable('prog4', 'prog.c', dependencies: d2)
37
test('linkwhole2', exe2)