From 475307db027de16cebcd847032589640a4f82082 Mon Sep 17 00:00:00 2001 From: Chiichen <2531693734@qq.com> Date: Sat, 2 Mar 2024 13:49:34 +0800 Subject: [PATCH] fix: fixed compile-time errors during cross-compiling --- lvgl-sys/build.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lvgl-sys/build.rs b/lvgl-sys/build.rs index 06fd7592..33f1a822 100644 --- a/lvgl-sys/build.rs +++ b/lvgl-sys/build.rs @@ -153,11 +153,13 @@ fn main() { cfg.include(&drivers); #[cfg(feature = "drivers")] cfg.includes(incl_extra.split(',')); - + cfg.includes(["/usr/include", "/usr/local/include"]); cfg.compile("lvgl"); - let mut cc_args = vec![ + let cc_args = vec![ "-DLV_CONF_INCLUDE_SIMPLE=1", + "-I/usr/include", + "-I/usr/local/include", "-I", lv_config_dir.to_str().unwrap(), "-I", @@ -167,11 +169,6 @@ fn main() { // Set correct target triple for bindgen when cross-compiling let target = env::var("TARGET").expect("Cargo build scripts always have TARGET"); - let host = env::var("HOST").expect("Cargo build scripts always have HOST"); - if target != host { - cc_args.push("-target"); - cc_args.push(target.as_str()); - } let mut additional_args = Vec::new(); if target.ends_with("emscripten") {