Debian Codegraph @

vendored-meson/meson/test cases/rust/14 external libm/meson.build

raw
1 project('rust linking to libm', 'c', 'rust')
2
3 if host_machine.system() == 'darwin'
4 error('MESON_SKIP_TEST: does not work right on macos, please fix!')
5 endif
6
7 cc = meson.get_compiler('c')
8 dep_m = cc.find_library('m', required : false, static : get_option('static'))
9 if not dep_m.found()
10 error('MESON_SKIP_TEST: Could not find a @0@ libm'.format(get_option('static') ? 'static' : 'shared'))
11 endif
12
13 librs_math = static_library(
14 'rs_math',
15 'rs_math.rs',
16 dependencies : [dep_m],
17 )
18
19 e = executable(
20 'prog', 'prog.rs',
21 link_with : [librs_math],
22 )
23
24 test('cdepstest', e)