Debian Codegraph @

vendored-meson/meson/test cases/unit/15 prebuilt object/meson.build

raw
1 # This test is on its own because it is special.
2 # To run the test you need the prebuilt object
3 # file for the given platform.
4 #
5 # Combined with cross compilation this would make
6 # the state space explode so let's just keep this
7 # in its own subdir so it's not run during cross
8 # compilation tests.
9
10 project('prebuilt object', 'c')
11
12 if host_machine.system() == 'windows'
13 prebuilt = 'prebuilt.obj'
14 else
15 prebuilt = 'prebuilt.o'
16 endif
17
18 # Remember: do not put source.c in this
19 # declaration. run_tests.py generates the
20 # prebuilt object before running this test.
21
22 e = []
23
24 e += executable('exe1', sources: 'main.c', objects: prebuilt)
25 e += executable('exe2', sources: 'main.c', objects: files(prebuilt))
26
27 sl1 = static_library('lib3', objects: prebuilt)
28 e += executable('exe3', sources: 'main.c', objects: sl1.extract_all_objects(recursive: true))
29
30 ct = custom_target(output: 'copy-' + prebuilt, input: prebuilt,
31 command: [find_program('cp.py'), '@INPUT@', '@OUTPUT@'])
32 e += executable('exe4', 'main.c', ct)
33 e += executable('exe5', 'main.c', ct[0])
34
35 sl2 = static_library('lib6', sources: ct)
36 e += executable('exe6', sources: 'main.c', objects: sl2.extract_all_objects(recursive: true))
37
38 e += executable('exe7', sources: 'main.c', objects: ct)
39 e += executable('exe8', sources: 'main.c', objects: ct[0])
40
41 sl3 = static_library('lib9', objects: ct)
42 e += executable('exe9', sources: 'main.c', objects: sl2.extract_all_objects(recursive: true))
43
44 foreach i : e
45 test(i.name(), i)
46 endforeach