- Added port_mass_flows to Component trait and implements for core components. - Added System::check_mass_balance and integrated it into the solver. - Restored connect methods for ExpansionValve, Compressor, and Pipe to fix integration tests. - Updated Python and C bindings for validation errors. - Updated sprint status and story documentation.
35 lines
1.1 KiB
Rust
35 lines
1.1 KiB
Rust
use std::env;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
let output_file = PathBuf::from(&crate_dir)
|
|
.parent()
|
|
.unwrap()
|
|
.parent()
|
|
.unwrap()
|
|
.join("target")
|
|
.join("entropyk.h");
|
|
|
|
let mut config =
|
|
cbindgen::Config::from_file("cbindgen.toml").expect("Failed to read cbindgen.toml");
|
|
|
|
config.header = Some("/* Auto-generated by cbindgen. Do not modify. */".to_string());
|
|
config.include_guard = Some("ENTROPYK_H".to_string());
|
|
config.language = cbindgen::Language::C;
|
|
|
|
cbindgen::Builder::new()
|
|
.with_crate(&crate_dir)
|
|
.with_config(config)
|
|
.generate()
|
|
.expect("Unable to generate C bindings")
|
|
.write_to_file(&output_file);
|
|
|
|
println!("cargo:rerun-if-changed=cbindgen.toml");
|
|
println!("cargo:rerun-if-changed=src/lib.rs");
|
|
println!("cargo:rerun-if-changed=src/error.rs");
|
|
println!("cargo:rerun-if-changed=src/system.rs");
|
|
println!("cargo:rerun-if-changed=src/components.rs");
|
|
println!("cargo:rerun-if-changed=src/solver.rs");
|
|
}
|