build.rs 1.0 KB

1234567891011121314151617181920212223242526272829
  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. if !has_lightning_backend {
  18. panic!(
  19. "cdk-mintd requires at least one Lightning backend to be enabled.\n\
  20. Available Lightning backends: cln, lnd, lnbits, fakewallet, grpc-processor\n\
  21. Example: cargo build --features \"sqlite fakewallet\""
  22. );
  23. }
  24. println!("cargo:rerun-if-changed=build.rs");
  25. }