File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -32,13 +32,22 @@ fn main() {
3232 println ! ( "cargo:warning=Building on Windows" ) ;
3333 println ! ( "cargo:warning=Using ECAL_HOME = {ecal_home}" ) ;
3434 } else if cfg ! ( target_os = "linux" ) {
35- // --- Linux: Assume system-wide install ---
36- println ! ( "cargo:rustc-link-lib=dylib=ecal_core_c" ) ;
37- println ! ( "cargo:rustc-link-search=native=/usr/local/lib" ) ; // Or /usr/lib if needed
35+ match env:: var ( "ECAL_HOME" ) {
36+ Ok ( ecal_home) => {
37+ println ! ( "cargo:warning=Using ECAL_HOME = {ecal_home}" ) ;
38+ let include_path = format ! ( "{ecal_home}/include" ) ;
39+ let lib_path = format ! ( "{ecal_home}/lib" ) ;
40+
41+ println ! ( "cargo:rustc-link-search=native={lib_path}" ) ;
3842
39- builder = builder
40- . clang_arg ( "-I/usr/include" )
41- . clang_arg ( "-I/usr/local/include" ) ;
43+ builder = builder. clang_arg ( format ! ( "-I{include_path}" ) ) ;
44+ }
45+ _ => {
46+ println ! ( "cargo:warning=Using system-wide eCAL install" ) ;
47+ }
48+ } ;
49+
50+ println ! ( "cargo:rustc-link-lib=dylib=ecal_core_c" ) ;
4251
4352 // Debug info
4453 println ! ( "cargo:warning=Building on Linux" ) ;
You can’t perform that action at this time.
0 commit comments