File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,7 @@ export NIXL_PREFIX=${INSTALL_DIR}
4646
4747cargo test -- --test-threads=1
4848
49+ # test stubs build
50+ cargo build --features stub-api
51+
4952cargo package
Original file line number Diff line number Diff line change @@ -201,6 +201,21 @@ fn build_stubs(cc_builder: &mut cc::Build) {
201201 // Tell cargo to invalidate the built crate whenever the stubs change
202202 println ! ( "cargo:rerun-if-changed=stubs.cpp" ) ;
203203 println ! ( "cargo:rerun-if-changed=wrapper.h" ) ;
204+
205+ // Get the output path for bindings
206+ let out_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
207+
208+ // Generate bindings with minimal configuration
209+ bindgen:: Builder :: default ( )
210+ . header ( "wrapper.h" )
211+ . clang_arg ( "-std=c++17" )
212+ . clang_arg ( "-x" )
213+ . clang_arg ( "c++" )
214+ . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks :: new ( ) ) )
215+ . generate ( )
216+ . expect ( "Unable to generate bindings" )
217+ . write_to_file ( out_path. join ( "bindings.rs" ) )
218+ . expect ( "Couldn't write bindings!" ) ;
204219}
205220
206221fn run_build ( use_stub_api : bool ) {
You can’t perform that action at this time.
0 commit comments