build.rs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #![allow(clippy::unwrap_used)]
  2. fn main() {
  3. // Check that at least one database feature is enabled
  4. let has_database = cfg!(feature = "sqlite") || cfg!(feature = "postgres");
  5. if !has_database {
  6. panic!(
  7. "cdk-mintd requires at least one database backend to be enabled.\n\
  8. Available database features: sqlite, postgres\n\
  9. Example: cargo build --features sqlite"
  10. );
  11. }
  12. // Check that at least one Lightning backend is enabled
  13. let has_lightning_backend = cfg!(feature = "cln")
  14. || cfg!(feature = "lnd")
  15. || cfg!(feature = "lnbits")
  16. || cfg!(feature = "fakewallet")
  17. || cfg!(feature = "grpc-processor")
  18. || cfg!(feature = "ldk-node");
  19. if !has_lightning_backend {
  20. panic!(
  21. "cdk-mintd requires at least one Lightning backend to be enabled.\n\
  22. Available Lightning backends: cln, lnd, lnbits, fakewallet, grpc-processor\n\
  23. Example: cargo build --features \"sqlite fakewallet\""
  24. );
  25. }
  26. println!("cargo:rerun-if-changed=build.rs");
  27. }