codemp/build.rs

27 lines
606 B
Rust
Raw Permalink Normal View History

2024-03-10 12:42:56 +01:00
#[cfg(feature = "js")]
extern crate napi_build;
#[cfg(any(feature = "py", feature = "py-noabi"))]
extern crate pyo3_build_config;
2024-03-09 23:27:08 +01:00
/// The main method of the buildscript, required by some glue modules.
fn main() {
#[cfg(feature = "js")]
{
2024-03-10 12:42:56 +01:00
napi_build::setup();
}
#[cfg(any(feature = "py", feature = "py-noabi"))]
{
pyo3_build_config::add_extension_module_link_args();
}
#[cfg(feature = "lua")]
{
if let Ok("macos") = std::env::var("CARGO_CFG_TARGET_OS").as_deref() {
println!("cargo:rustc-cdylib-link-arg=-undefined");
2024-10-01 00:42:57 +02:00
println!("cargo:rustc-cdylib-link-arg=dynamic_lookup");
}
}
2024-03-09 23:27:08 +01:00
}