mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
This commit mostly just fixes compilation errors when compiling in C++20 mode, though the change to std::filesystem::path::u8string()'s return type means it's not backwards-compatible with C++17.
21 lines
729 B
Rust
21 lines
729 B
Rust
fn main() {
|
|
cxx_build::bridge("src/lib.rs")
|
|
.std("c++20")
|
|
.flag_if_supported("/Zc:__cplusplus")
|
|
.flag_if_supported("/permissive-")
|
|
.compile("libloot-cpp");
|
|
|
|
// From <https://github.com/dtolnay/cxx/issues/880#issuecomment-2521375384>
|
|
if std::env::var("TARGET").is_ok_and(|s| s.contains("windows-msvc")) {
|
|
// MSVC compiler suite
|
|
if std::env::var("CFLAGS").is_ok_and(|s| s.contains("/MDd")) {
|
|
// debug runtime flag is set
|
|
|
|
// Don't link the default CRT
|
|
println!("cargo::rustc-link-arg=/nodefaultlib:msvcrt");
|
|
// Link the debug CRT instead
|
|
println!("cargo::rustc-link-arg=/defaultlib:msvcrtd");
|
|
}
|
|
}
|
|
}
|