add use-vendored-config feature

This commit is contained in:
Jay Jackson 2022-05-17 21:35:05 -04:00 committed by Rafael Carício
parent faa3a19215
commit 601a87d513
3 changed files with 14 additions and 4 deletions

View file

@ -22,3 +22,6 @@ cty = "0.2.1"
[build-dependencies]
cc = "1.0.68"
bindgen = "0.59.2"
[features]
use-vendored-config = []

View file

@ -19,10 +19,16 @@ fn main() {
// so let's use the vendored `lv_conf.h` file.
vendor.join("include")
}
Err(_) => panic!(
"The environment variable {} is required to be defined",
CONFIG_NAME
),
Err(_) => {
#[cfg(not(feature = "use-vendored-config"))]
panic!(
"The environment variable {} is required to be defined",
CONFIG_NAME
);
#[cfg(feature = "use-vendored-config")]
vendor.join("include")
}
}
});

View file

@ -21,6 +21,7 @@ bitflags = "1.2.1"
[features]
alloc = ["cstr_core/alloc"]
lvgl_alloc = ["alloc"]
use-vendored-config = ["lvgl-sys/use-vendored-config"]
[build-dependencies]
quote = "1.0.9"