fn main() {
println!(
"cargo:rustc-env=PYEMBED_TESTS_DIR={}/src/test",
std::env::var("CARGO_MANIFEST_DIR").unwrap()
);
if let Ok(os) = std::env::var("CARGO_CFG_TARGET_OS") {
match os.as_str() {
"linux" => {
println!("cargo:rustc-link-arg=-Wl,-export-dynamic");
}
"macos" => {
println!("cargo:rustc-link-arg=-rdynamic");
}
_ => {}
}
}
let interpreter_config = pyo3_build_config::get();
let python_interpreter = interpreter_config
.executable
.as_ref()
.expect("PyO3 configuration does not define Python executable path");
println!(
"cargo:rustc-env=PYTHON_INTERPRETER_PATH={}",
python_interpreter
);
}