pub type BoxError = Box<dyn std::error::Error>;
#[path = "build/codegen.rs"]
mod codegen;
#[path = "build/geojson.rs"]
mod geojson;
#[cfg(feature = "basic")]
#[path = "build/impl/basic.rs"]
mod basic;
#[cfg(feature = "rtree")]
#[path = "build/impl/rtree.rs"]
mod rtree;
#[cfg(feature = "s2cell")]
#[path = "build/impl/s2cell.rs"]
mod s2cell;
fn main() -> Result<(), BoxError> {
println!("cargo:rustc-check-cfg=cfg(have_basic_prebuilt)");
let Some(timezones) = geojson::extract_timezones()? else {
eprintln!("Skipping timezone codegen (no source geojson present)");
return Ok(());
};
eprintln!("Processed timezone polygons");
#[cfg(feature = "basic")]
{
basic::build(&timezones)?;
println!("cargo:rustc-cfg=have_basic_prebuilt");
}
#[cfg(feature = "rtree")]
rtree::build(&timezones)?;
#[cfg(feature = "s2cell")]
s2cell::build(&timezones)?;
eprintln!("Wrote data files");
Ok(())
}