File: meson.build

package info (click to toggle)
numpy 1%3A2.2.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 83,420 kB
  • sloc: python: 248,499; asm: 232,365; ansic: 216,874; cpp: 135,657; f90: 1,540; sh: 938; fortran: 558; makefile: 409; sed: 139; xml: 109; java: 92; perl: 79; cs: 54; javascript: 53; objc: 29; lex: 13; yacc: 9
file content (42 lines) | stat: -rw-r--r-- 1,253 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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_stlibs.py')

clib = custom_target('linkcustom',
  output: ['libflob_1.a', 'libflob_2.a'],
  command: [genprog,
            '-o', '@OUTPUT@',
            '--private-dir', '@PRIVATE_DIR@'] + cc.cmd_array())

clibs = [clib[0], clib[1]]

exe = executable('prog', 'prog.c', link_with: clibs)
test('linkcustom', exe)

d = declare_dependency(link_with: clibs)

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: clibs)
test('linkwhole', exe)

d2 = declare_dependency(link_whole: clibs)

exe4 = executable('prog4', 'prog.c', dependencies: d2)
test('linkwhole2', exe2)