rust/tests/run-make/native-lib-alt-naming/rmake.rs
Vadim Petrochenkov 05bd36de50 linker: Better support alternative static library naming on MSVC
Previously `libname.a` naming was supported as a fallback when producing rlibs, but not when producing executables or dynamic libraries
2024-08-27 22:13:31 +03:00

16 lines
531 B
Rust

// On MSVC the alternative naming format for static libraries (`libfoo.a`) is accepted in addition
// to the default format (`foo.lib`).
//REMOVE@ only-msvc
use run_make_support::rustc;
fn main() {
// Prepare the native library.
rustc().input("native.rs").crate_type("staticlib").output("libnative.a").run();
// Try to link to it from both a rlib and a bin.
rustc().input("rust.rs").crate_type("rlib").arg("-lstatic=native").run();
rustc().input("rust.rs").crate_type("bin").arg("-lstatic=native").run();
}