For the same reason as for static libraries, we have to use -l when generating static executables. Fixes: https://github.com/mesonbuild/meson/issues/12585pull/12750/head
parent
bd3f1b2e0e
commit
1ca2c74d16
6 changed files with 37 additions and 1 deletions
@ -0,0 +1,6 @@ |
||||
#include <stdio.h> |
||||
|
||||
void test_function(void) |
||||
{ |
||||
puts("Hello, world!"); |
||||
} |
@ -0,0 +1,9 @@ |
||||
extern "C" { |
||||
fn test_function(); |
||||
} |
||||
|
||||
pub fn main() { |
||||
unsafe { |
||||
test_function(); |
||||
} |
||||
} |
@ -0,0 +1,9 @@ |
||||
project('rustprog', 'c') |
||||
|
||||
if not add_languages('rust', required : false) |
||||
error('MESON_SKIP_TEST crt-static doesn\'t work') |
||||
endif |
||||
|
||||
c_lib = static_library('lib', 'lib.c') |
||||
|
||||
executable('main', 'main.rs', link_with : c_lib) |
@ -0,0 +1,5 @@ |
||||
{ |
||||
"env": { |
||||
"RUSTC": "rustc -C target-feature=+crt-static" |
||||
} |
||||
} |
Loading…
Reference in new issue