1
0

build.rs 819 B

12345678910111213
  1. // warn if the "read-config" feature is enabled, but the DIOXUS_CONFIG environment variable is not set
  2. // This means that some library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application.
  3. fn main() {
  4. built::write_built_file().expect("Failed to acquire build-time information");
  5. println!("cargo:rerun-if-env-changed=DIOXUS_CONFIG");
  6. let dioxus_config = std::env::var("DIOXUS_CONFIG");
  7. let built_with_dioxus = dioxus_config.is_ok();
  8. if cfg!(feature = "read-config") && !built_with_dioxus {
  9. println!("cargo:warning=A library is trying to access the crate's configuration, but the dioxus CLI was not used to build the application. Information about the Dioxus CLI is available at https://dioxuslabs.com/learn/0.5/CLI/installation");
  10. }
  11. }