~mmach/netext73/meson

« back to all changes in this revision

Viewing changes to test cases/common/210 link custom_i single from multiple/meson.build

  • Committer: mmach
  • Date: 2021-02-15 11:29:44 UTC
  • Revision ID: netbit73@gmail.com-20210215112944-fpso7tr2yog0tam1
57

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project('linkcustom', 'c')
 
2
 
 
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.')
 
9
 
 
10
cc = meson.get_compiler('c')
 
11
genprog = find_program('generate_conflicting_stlibs.py')
 
12
 
 
13
clib = custom_target('linkcustom',
 
14
  output: ['libflob_1.a', 'libflob_2.a'],
 
15
  command: [genprog,
 
16
            '-o', '@OUTPUT@',
 
17
            '--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array())
 
18
 
 
19
clib_2 = clib[1]
 
20
 
 
21
exe = executable('prog', 'prog.c', link_with: clib_2)
 
22
test('linkcustom', exe)
 
23
 
 
24
d = declare_dependency(link_with: clib_2)
 
25
 
 
26
exe2 = executable('prog2', 'prog.c', dependencies: d)
 
27
test('linkcustom2', exe2)
 
28
 
 
29
# Link whole tests
 
30
 
 
31
exe3 = executable('prog3', 'prog.c', link_whole: clib_2)
 
32
test('linkwhole', exe)
 
33
 
 
34
d2 = declare_dependency(link_whole: clib_2)
 
35
 
 
36
exe4 = executable('prog4', 'prog.c', dependencies: d2)
 
37
test('linkwhole2', exe2)