File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 11fn main ( ) {
22 cc:: Build :: new ( )
33 . file ( "src/cxx.cc" )
4+ . cpp ( true )
5+ . cpp_link_stdlib ( None ) // linked via link-cplusplus crate
46 . flag ( "-std=c++11" )
57 . compile ( "cxxbridge03" ) ;
68 println ! ( "cargo:rerun-if-changed=src/cxx.cc" ) ;
Original file line number Diff line number Diff line change @@ -88,12 +88,16 @@ pub fn bridge(rust_source_file: impl AsRef<Path>) -> cc::Build {
8888/// ```
8989pub fn bridges ( rust_source_files : impl IntoIterator < Item = impl AsRef < Path > > ) -> cc:: Build {
9090 let mut build = paths:: cc_build ( ) ;
91+ build. cpp ( true ) ;
92+ build. cpp_link_stdlib ( None ) ; // linked via link-cplusplus crate
93+
9194 for path in rust_source_files {
9295 if let Err ( err) = try_generate_bridge ( & mut build, path. as_ref ( ) ) {
9396 let _ = writeln ! ( io:: stderr( ) , "\n \n cxxbridge error: {:?}\n \n " , anyhow!( err) ) ;
9497 process:: exit ( 1 ) ;
9598 }
9699 }
100+
97101 build
98102}
99103
You can’t perform that action at this time.
0 commit comments