add use-vendored-config feature #56

Merged
TheBotlyNoob merged 1 commit from add-vendored-config-feature into master 2022-05-19 12:23:44 +00:00
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"