build.rs 1.0 KB

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