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