Debian Codegraph @

test cases/rust/13 external c dependencies/meson.build

raw
1 project('rust linking to c using dependency', 'c', 'rust')
2
3 dep_zlib = dependency('zlib', static : get_option('static'), method : get_option('method'), required : false)
4 if not dep_zlib.found()
5 error('MESON_SKIP_TEST: Could not find a @0@ zlib'.format(get_option('static') ? 'static' : 'shared'))
6 endif
7
8 l = static_library(
9 'c_accessing_zlib',
10 'c_accessing_zlib.c',
11 dependencies: [dep_zlib],
12 )
13
14 e = executable(
15 'prog', 'prog.rs',
16 link_with : l,
17 )
18
19 test('cdepstest', e)
20
21 e2 = executable(
22 'prog2', 'prog.rs',
23 dependencies : declare_dependency(link_with: l, sources: files('foo.h')),
24 )
25
26 test('cdepstest', e2)