@@ -3,9 +3,11 @@ extern crate bindgen;
3
3
use std:: env;
4
4
use std:: path:: { Path , PathBuf } ;
5
5
6
+ const RELATIVE_PATH_TO_CASSANDRA_H : & str = "../include/cassandra.h" ;
7
+
6
8
fn prepare_full_bindings ( out_path : & Path ) {
7
9
let bindings = bindgen:: Builder :: default ( )
8
- . header ( "extern/cassandra.h" )
10
+ . header ( RELATIVE_PATH_TO_CASSANDRA_H )
9
11
. parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) )
10
12
. layout_tests ( false )
11
13
. generate_comments ( false )
@@ -23,7 +25,7 @@ fn prepare_full_bindings(out_path: &Path) {
23
25
24
26
fn prepare_basic_types ( out_path : & Path ) {
25
27
let basic_bindings = bindgen:: Builder :: default ( )
26
- . header ( "extern/cassandra.h" )
28
+ . header ( RELATIVE_PATH_TO_CASSANDRA_H )
27
29
. parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) )
28
30
. layout_tests ( true )
29
31
. generate_comments ( false )
@@ -56,7 +58,7 @@ fn prepare_basic_types(out_path: &Path) {
56
58
57
59
fn prepare_cppdriver_data ( outfile : & str , allowed_types : & [ & str ] , out_path : & Path ) {
58
60
let mut type_bindings = bindgen:: Builder :: default ( )
59
- . header ( "extern/cassandra.h" )
61
+ . header ( RELATIVE_PATH_TO_CASSANDRA_H )
60
62
. parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks ) )
61
63
. layout_tests ( true )
62
64
. generate_comments ( false )
@@ -79,7 +81,7 @@ fn prepare_cppdriver_data(outfile: &str, allowed_types: &[&str], out_path: &Path
79
81
}
80
82
81
83
fn main ( ) {
82
- println ! ( "cargo:rerun-if-changed=extern/cassandra.h" ) ;
84
+ println ! ( "cargo:rerun-if-changed={}" , RELATIVE_PATH_TO_CASSANDRA_H ) ;
83
85
let out_path = PathBuf :: from ( env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
84
86
prepare_full_bindings ( & out_path) ;
85
87
prepare_basic_types ( & out_path) ;
0 commit comments