mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 23:03:06 +03:00
Migrate run-make/glibc-staticlib-args to rmake.rs
This commit is contained in:
@@ -59,7 +59,6 @@ run-make/forced-unwind-terminate-pof/Makefile
|
||||
run-make/foreign-double-unwind/Makefile
|
||||
run-make/foreign-exceptions/Makefile
|
||||
run-make/foreign-rust-exceptions/Makefile
|
||||
run-make/glibc-staticlib-args/Makefile
|
||||
run-make/include_bytes_deps/Makefile
|
||||
run-make/incr-add-rust-src-component/Makefile
|
||||
run-make/incr-foreign-head-span/Makefile
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# ignore-cross-compile
|
||||
# only-gnu
|
||||
# only-linux
|
||||
|
||||
include ../tools.mk
|
||||
|
||||
# This ensures that std::env::args works in a library called from C on glibc Linux.
|
||||
|
||||
all:
|
||||
$(RUSTC) --crate-type=staticlib library.rs
|
||||
$(CC) program.c $(call STATICLIB,library) $(call OUT_EXE,program) \
|
||||
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
|
||||
$(call RUN,program)
|
||||
@@ -0,0 +1,18 @@
|
||||
// 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")
|
||||
.args(&extra_c_flags())
|
||||
.args(&extra_cxx_flags())
|
||||
.run();
|
||||
run(&bin_name("program"));
|
||||
}
|
||||
Reference in New Issue
Block a user