Debian Codegraph @

test cases/unit/39 external, internal library rpath/built library/meson.build

raw
1 project('built library', 'c')
2
3 cc = meson.get_compiler('c')
4
5 import('python').find_installation().install_sources('foo.py')
6
7 if host_machine.system() != 'cygwin'
8 # bar_in_system has undefined symbols, but still must be found
9 bar_system_dep = cc.find_library('bar_in_system')
10 endif
11
12 foo_system_dep = cc.find_library('foo_in_system')
13
14 faa_pkg_dep = dependency('faa_pkg')
15
16 l = shared_library('bar_built', 'bar.c',
17 install: true,
18 dependencies : [foo_system_dep, faa_pkg_dep])
19
20 if host_machine.system() == 'darwin'
21 e = executable('prog', 'prog.c', link_with: l, install: true)
22 test('testprog', e)
23 elif host_machine.system() == 'linux'
24 e = executable('prog', 'prog.c', link_with: l, install: true,
25 install_rpath: '$ORIGIN/..' / get_option('libdir'),
26 )
27 test('testprog', e)
28 endif