| 1 |
project('internal dependencies', 'c', 'rust') |
| 2 |
|
| 3 |
test_prog = find_program('test.py') |
| 4 |
|
| 5 |
static = static_library('static', 'lib.c', c_args : '-DMODE="static"') |
| 6 |
# Add some -I compiler arguments to make sure they're not passed to the Rust |
| 7 |
# compiler when handling the dependency. |
| 8 |
static_dep = declare_dependency(link_with : static, compile_args : ['-Idoesnotexist']) |
| 9 |
exe = executable('static', 'main.rs', dependencies : static_dep) |
| 10 |
test('static linkage', test_prog, args : [exe, 'This is a static C library']) |
| 11 |
|
| 12 |
# Shared linkage with rust doesn't work on macOS with meson, yet |
| 13 |
if host_machine.system() != 'darwin' |
| 14 |
shared = shared_library('shared', 'lib.c', c_args : '-DMODE="shared"') |
| 15 |
shared_dep = declare_dependency(link_with : shared, compile_args : ['-Idoesnotexist']) |
| 16 |
exe = executable('shared', 'main.rs', dependencies : shared_dep) |
| 17 |
test('shared linkage', test_prog, args : [exe, 'This is a shared C library']) |
| 18 |
endif |