2024-06-19 06:57:01 -05:00
|
|
|
// This ensures that std::env::args works in a library called from C on glibc Linux.
|
|
|
|
|
|
|
|
//@ only-gnu
|
|
|
|
//@ only-linux
|
|
|
|
//@ ignore-cross-compile
|
|
|
|
|
|
|
|
use run_make_support::{bin_name, cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
rustc().input("library.rs").crate_type("staticlib").run();
|
|
|
|
cc().input("program.c")
|
|
|
|
.arg(static_lib_name("library"))
|
|
|
|
.out_exe("program")
|
2024-06-30 05:40:24 -05:00
|
|
|
.args(extra_c_flags())
|
|
|
|
.args(extra_cxx_flags())
|
2024-06-19 06:57:01 -05:00
|
|
|
.run();
|
|
|
|
run(&bin_name("program"));
|
|
|
|
}
|