主要改了 vendor/esaxx-rs/build.rs:只在 crt-static 目标下才启用 static_crt(true),用来修复 Windows 下常见的 MSVC 运行库冲突
This commit is contained in:
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
#[cfg(feature = "cpp")]
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
fn main() {
|
||||
let mut build = cc::Build::new();
|
||||
build.cpp(true).flag("-std=c++11");
|
||||
|
||||
if std::env::var("CARGO_CFG_TARGET_FEATURE")
|
||||
.unwrap_or_default()
|
||||
.contains("crt-static")
|
||||
{
|
||||
build.static_crt(true);
|
||||
}
|
||||
|
||||
build.file("src/esaxx.cpp").include("src").compile("esaxx");
|
||||
}
|
||||
|
||||
#[cfg(feature = "cpp")]
|
||||
#[cfg(target_os = "macos")]
|
||||
fn main() {
|
||||
let mut build = cc::Build::new();
|
||||
build.cpp(true).flag("-std=c++11").flag("-stdlib=libc++");
|
||||
|
||||
if std::env::var("CARGO_CFG_TARGET_FEATURE")
|
||||
.unwrap_or_default()
|
||||
.contains("crt-static")
|
||||
{
|
||||
build.static_crt(true);
|
||||
}
|
||||
|
||||
build.file("src/esaxx.cpp").include("src").compile("esaxx");
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "cpp"))]
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user