@@ -3,9 +3,11 @@ extern crate libbindgen;
33fn main ( ) {
44 //look for libvlccore in the current directory while in development
55 println ! ( "cargo:rustc-link-search=native=." ) ;
6+ let include_arg = concat ! ( "-I" , env!( "INCLUDE_DIR" ) ) ;
7+
68 let _ = libbindgen:: builder ( )
7- . clang_arg ( "-I include/" )
8- . header ( "include /vlc_common.h")
9+ . clang_arg ( include_arg )
10+ . header ( concat ! ( env! ( "INCLUDE_DIR" ) , " /vlc_common.h") )
911 . whitelisted_type ( "vlc_fourcc_t" )
1012 . whitelisted_type ( "mtime_t" )
1113 . whitelisted_type ( "es_out_id_t" )
@@ -15,17 +17,17 @@ fn main() {
1517 . write_to_file ( "src/ffi/common.rs" ) ;
1618
1719 let _ = libbindgen:: builder ( )
18- . clang_arg ( "-I include/" )
19- . header ( "include /vlc_plugin.h")
20+ . clang_arg ( include_arg )
21+ . header ( concat ! ( env! ( "INCLUDE_DIR" ) , " /vlc_plugin.h") )
2022 . whitelisted_type ( "vlc_module_properties" )
2123 . use_core ( )
2224 . generate ( ) . unwrap ( )
2325 . write_to_file ( "src/ffi/plugin.rs" ) ;
2426
2527/*
2628 let _ = libbindgen::builder()
27- .clang_arg("-I include/" )
28- .header("include /vlc_block.h")
29+ .clang_arg(include_arg )
30+ .header(concat!(env!("INCLUDE_DIR"), " /vlc_block.h") )
2931 //.whitelisted_type("block_t")
3032 .opaque_type("mtime_t")
3133 .hide_type("va_list")
@@ -38,8 +40,8 @@ fn main() {
3840
3941
4042 let _ = libbindgen:: builder ( )
41- . clang_arg ( "-I include/" )
42- . header ( "include /vlc_stream.h")
43+ . clang_arg ( include_arg )
44+ . header ( concat ! ( env! ( "INCLUDE_DIR" ) , " /vlc_stream.h") )
4345 . whitelisted_type ( "stream_t" )
4446 . whitelisted_function ( "stream_Read" )
4547 . whitelisted_function ( "stream_Tell" )
@@ -49,8 +51,8 @@ fn main() {
4951 . write_to_file ( "src/ffi/stream.rs" ) ;
5052
5153 let _ = libbindgen:: builder ( )
52- . clang_arg ( "-I include/" )
53- . header ( "include /vlc_demux.h")
54+ . clang_arg ( include_arg )
55+ . header ( concat ! ( env! ( "INCLUDE_DIR" ) , " /vlc_demux.h") )
5456 . whitelisted_function ( "demux_New" )
5557 . whitelisted_function ( "demux_vaControlHelper" )
5658 . hide_type ( "stream_t" )
@@ -69,8 +71,8 @@ fn main() {
6971 . write_to_file ( "src/ffi/demux.rs" ) ;
7072
7173 let _ = libbindgen:: builder ( )
72- . clang_arg ( "-I include/" )
73- . header ( "include /vlc_es.h")
74+ . clang_arg ( include_arg )
75+ . header ( concat ! ( env! ( "INCLUDE_DIR" ) , " /vlc_es.h") )
7476 . whitelisted_function ( "es_format_Init" )
7577 . whitelisted_type ( "es_format_category_e" )
7678 . hide_type ( "vlc_fourcc_t" )
@@ -80,8 +82,8 @@ fn main() {
8082 . write_to_file ( "src/ffi/es.rs" ) ;
8183
8284 let _ = libbindgen:: builder ( )
83- . clang_arg ( "-I include/" )
84- . header ( "include /vlc_es_out.h")
85+ . clang_arg ( include_arg )
86+ . header ( concat ! ( env! ( "INCLUDE_DIR" ) , " /vlc_es_out.h") )
8587 . whitelisted_type ( "es_out_query_e" )
8688 . use_core ( )
8789 . generate ( ) . unwrap ( )
0 commit comments