xref: /third_party/rust/crates/cxx/tests/ffi/build.rs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/rust/crates/cxx/tests/ffi/
133d722a9Sopenharmony_ciuse cxx_build::CFG;
233d722a9Sopenharmony_ci
333d722a9Sopenharmony_cifn main() {
433d722a9Sopenharmony_ci    if cfg!(trybuild) {
533d722a9Sopenharmony_ci        return;
633d722a9Sopenharmony_ci    }
733d722a9Sopenharmony_ci
833d722a9Sopenharmony_ci    CFG.include_prefix = "tests/ffi";
933d722a9Sopenharmony_ci    let sources = vec!["lib.rs", "module.rs"];
1033d722a9Sopenharmony_ci    let mut build = cxx_build::bridges(sources);
1133d722a9Sopenharmony_ci    build.file("tests.cc");
1233d722a9Sopenharmony_ci    build.flag_if_supported(cxxbridge_flags::STD);
1333d722a9Sopenharmony_ci    build.warnings_into_errors(cfg!(deny_warnings));
1433d722a9Sopenharmony_ci    if cfg!(not(target_env = "msvc")) {
1533d722a9Sopenharmony_ci        build.define("CXX_TEST_INSTANTIATIONS", None);
1633d722a9Sopenharmony_ci    }
1733d722a9Sopenharmony_ci    build.compile("cxx-test-suite");
1833d722a9Sopenharmony_ci
1933d722a9Sopenharmony_ci    println!("cargo:rerun-if-changed=tests.cc");
2033d722a9Sopenharmony_ci    println!("cargo:rerun-if-changed=tests.h");
2133d722a9Sopenharmony_ci}
22

Indexes created Thu Nov 07 10:32:03 CST 2024