| David Tolnay | d41eef5 | 2020-10-07 16:33:55 -0700 | [diff] [blame] | 1 | use cxx_build::CFG; |
| 2 | |
| David Tolnay | 97c7210 | 2020-01-25 16:49:00 -0800 | [diff] [blame] | 3 | fn main() { |
| 4 | if cfg!(trybuild) { |
| 5 | return; |
| 6 | } |
| 7 | |
| David Tolnay | d41eef5 | 2020-10-07 16:33:55 -0700 | [diff] [blame] | 8 | CFG.include_prefix = "tests/ffi"; |
| David Tolnay | fbd0a8d | 2020-11-19 14:22:08 -0800 | [diff] [blame] | 9 | let sources = vec!["lib.rs", "module.rs"]; |
| David Tolnay | 85805ce | 2021-01-02 20:06:24 -0800 | [diff] [blame] | 10 | let mut build = cxx_build::bridges(sources); |
| 11 | build.file("tests.cc"); |
| 12 | build.flag_if_supported(cxxbridge_flags::STD); |
| 13 | if cfg!(not(target_env = "msvc")) { |
| 14 | build.define("CXX_TEST_INSTANTIATIONS", None); |
| 15 | } |
| 16 | build.compile("cxx-test-suite"); |
| David Tolnay | 97c7210 | 2020-01-25 16:49:00 -0800 | [diff] [blame] | 17 | } |