1 use cxx_build::CFG; 2 main()3fn main() { 4 if cfg!(trybuild) { 5 return; 6 } 7 8 CFG.include_prefix = "tests/ffi"; 9 let sources = vec!["lib.rs", "module.rs"]; 10 let mut build = cxx_build::bridges(sources); 11 build.file("tests.cc"); 12 build.flag_if_supported(cxxbridge_flags::STD); 13 build.warnings_into_errors(cfg!(deny_warnings)); 14 if cfg!(not(target_env = "msvc")) { 15 build.define("CXX_TEST_INSTANTIATIONS", None); 16 } 17 build.compile("cxx-test-suite"); 18 19 println!("cargo:rerun-if-changed=tests.cc"); 20 println!("cargo:rerun-if-changed=tests.h"); 21 } 22