@@ -28,6 +28,15 @@ fn feature_enabled(feature: &str) -> bool {
2828/// - msys2 `/` is `C:\msys64\` in Windows by default install
2929/// - It can be convert using `cygpath` command
3030fn windows_gnu_system ( ) {
31+ let include_path = String :: from_utf8 (
32+ Command :: new ( "cygpath" )
33+ . arg ( "-w" )
34+ . arg ( "/mingw64/include" )
35+ . output ( )
36+ . expect ( "Failed to exec cygpath" )
37+ . stdout ,
38+ )
39+ . expect ( "cygpath output includes non UTF-8 string" ) ;
3140 let lib_path = String :: from_utf8 (
3241 Command :: new ( "cygpath" )
3342 . arg ( "-w" )
@@ -42,6 +51,8 @@ fn windows_gnu_system() {
4251 )
4352 . expect ( "cygpath output includes non UTF-8 string" ) ;
4453 println ! ( "cargo:rustc-link-search={}" , lib_path) ;
54+ println ! ( "cargo:INCLUDE={}" , include_path) ;
55+ println ! ( "cargo:LIBRARY={}" , lib_path) ;
4556}
4657
4758/// Use vcpkg for msvc "system" feature
@@ -75,6 +86,8 @@ fn macos_system() {
7586
7687 println ! ( "cargo:rustc-link-search={}/lib" , openblas. display( ) ) ;
7788 println ! ( "cargo:rustc-link-search={}/lib" , libomp. display( ) ) ;
89+ println ! ( "cargo:INCLUDE={}" , openblas. join( "include" ) . display( ) ) ;
90+ println ! ( "cargo:LIBRARY={}" , openblas. join( "lib" ) . display( ) ) ;
7891}
7992
8093fn main ( ) {
@@ -219,6 +232,8 @@ fn build() {
219232 } ;
220233
221234 println ! ( "cargo:rustc-link-search={}" , source. display( ) ) ;
235+ println ! ( "cargo:INCLUDE={}" , source. display( ) ) ;
236+ println ! ( "cargo:LIBRARY={}" , source. display( ) ) ;
222237 for search_path in & make_conf. c_extra_libs . search_paths {
223238 println ! ( "cargo:rustc-link-search={}" , search_path. display( ) ) ;
224239 }
0 commit comments