@@ -2,26 +2,8 @@ extern crate cmake;
22extern crate bindgen;
33
44use std:: env;
5- use std:: path:: PathBuf ;
65
76fn main ( ) {
8- let bindings = bindgen:: Builder :: default ( )
9- . header ( "wrapper.h" )
10- . use_core ( )
11- . ctypes_prefix ( "libc" )
12- . whitelist_function ( ".*compress.*" )
13- . whitelist_function ( ".*shuffle.*" )
14- . whitelist_function ( ".*threads.*" )
15- . whitelist_function ( ".*version.*" )
16- . generate ( )
17- . expect ( "Unable to generate bindings" ) ;
18-
19- // Write the bindings to the $OUT_DIR/bindings.rs file.
20- let out_path = PathBuf :: from ( env:: var ( "CARGO_MANIFEST_DIR" ) . unwrap ( ) ) ;
21- bindings
22- . write_to_file ( out_path. join ( "src/bindings.rs" ) )
23- . expect ( "Couldn't write bindings!" ) ;
24-
257 // TODO deduplicate code, only MinGW line for Windows, check if on MSVC
268 if cfg ! ( windows) {
279 if cfg ! ( target_env = "gnu" ) {
@@ -58,7 +40,7 @@ fn main() {
5840 . define ( "PREFER_EXTERNAL_SNAPPY" , "OFF" )
5941 . define ( "PREFER_EXTERNAL_ZLIB" , "OFF" )
6042 . define ( "PREFER_EXTERNAL_ZSTD" , "OFF" )
61- // .define("CMAKE_BUILD_TYPE", "Release") - cmake-rs does the right this depending on opt-level and debug/release
43+ // .define("CMAKE_BUILD_TYPE", "Release") - cmake-rs does this right depending on opt-level and debug/release
6244 . static_crt ( true )
6345 . build ( ) ;
6446 println ! ( "cargo:rustc-link-search=native={}/lib" , dst. display( ) ) ;
@@ -83,4 +65,21 @@ fn main() {
8365 println ! ( "cargo:rustc-link-search=native={}/lib" , dst. display( ) ) ;
8466 println ! ( "cargo:rustc-link-lib=static=blosc" ) ;
8567 }
68+
69+ // let bindings = bindgen::Builder::default()
70+ // .header("wrapper.h")
71+ // .use_core()
72+ // .ctypes_prefix("libc")
73+ // .whitelist_function(".*compress.*")
74+ // .whitelist_function(".*shuffle.*")
75+ // .whitelist_function(".*threads.*")
76+ // .whitelist_function(".*version.*")
77+ // .generate()
78+ // .expect("Unable to generate bindings");
79+
80+ // // Write the bindings to the $OUT_DIR/bindings.rs file.
81+ // let out_path = std::path::PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
82+ // bindings
83+ // .write_to_file(out_path.join("src/bindings.rs"))
84+ // .expect("Couldn't write bindings!");
8685}
0 commit comments