mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-24 07:40:19 +00:00
9808ef177c
Currently unused, but will be needed when integrating std::optional or std::string_view support. [dependencies] cxx = { version = "0.3", features = ["c++17"] }
17 lines
489 B
Rust
17 lines
489 B
Rust
fn main() {
|
|
cc::Build::new()
|
|
.file("src/cxx.cc")
|
|
.cpp(true)
|
|
.cpp_link_stdlib(None) // linked via link-cplusplus crate
|
|
.flag_if_supported(if cfg!(feature = "c++17") {
|
|
"-std=c++17"
|
|
} else if cfg!(feature = "c++14") {
|
|
"-std=c++14"
|
|
} else {
|
|
"-std=c++11"
|
|
})
|
|
.compile("cxxbridge03");
|
|
println!("cargo:rerun-if-changed=src/cxx.cc");
|
|
println!("cargo:rerun-if-changed=include/cxx.h");
|
|
}
|