cmake-rs
cmake-rs copied to clipboard
Definitions added via `Config::define` are not present
as the title states, i try defining a variable like i would from the commandline with -D, and i get nothing in cmake itself or the source code, nothing is defined at all
Could you produce a code sample?
damn, im sorry for leaving you hanging for 4 days
fn gxmite() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=submodules/gxmite");
let mut cfg = cmake::Config::new("submodules/gxmite");
if std::env::var("PROFILE")?.as_str() == "debug" {
cfg.define("debug_assertions", "true"); // here
}
cfg.build_target("gxmite");
let dst = cfg.build();
println!("cargo:rustc-link-search=native={}", dst.join("lib").display());
println!("cargo:rustc-link-lib=static=gxmite");
Ok(())
}
since i made the issue ive figured out that it gets defined for cmake and not my program, so things like #ifdef dont ever see it, meaning i most likely need to do something in my cmake file or there is some other part of this crate i dont know of yet