use cxx_build::CFG;
fn main() {
if std::env::var("DOCS_RS").is_err() {
cmake::Config::new("klotski")
.define("KLSK_ENABLE_LTO:BOOL", "ON")
.build();
println!("cargo:rustc-link-lib=static=klotski_core");
CFG.include_prefix = "rust_ffi";
cxx_build::bridge("src/bridge.rs")
.file("adapter/layout.cc")
.file("adapter/short_code.cc")
.include("klotski/src/core")
.flag("-std=c++23")
.flag_if_supported("-flto=full") .flag("-fno-rtti")
.flag("-fno-exceptions")
.compile("klotski");
}
println!("cargo:rerun-if-changed=src/bridge.rs");
println!("cargo:rerun-if-changed=adapter/layout.cc");
println!("cargo:rerun-if-changed=adapter/short_code.cc");
}