diff --git a/ica-rs/Cargo.toml b/ica-rs/Cargo.toml index 2afab5f..c33d468 100644 --- a/ica-rs/Cargo.toml +++ b/ica-rs/Cargo.toml @@ -2,6 +2,7 @@ name = "ica-rs" version = "0.1.0" edition = "2021" +build = "build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,3 +16,6 @@ toml = "0.8.8" [patch.crates-io] rust_socketio = { path = "../../../rust-socketio/socketio" } + +[build-dependencies] + diff --git a/ica-rs/build.rs b/ica-rs/build.rs new file mode 100644 index 0000000..8b48414 --- /dev/null +++ b/ica-rs/build.rs @@ -0,0 +1,19 @@ +use std::env; + +// 指定 pyo3 的绑定对象 +fn pyo3_config() { + // PYO3_PYTHON=xxxx + #[cfg(windows)] + { + env::set_var("PYO3_PYTHON", "python3.10") + } + // wsl + #[cfg(target_os = "linux")] + { + env::set_var("PYO3_PYTHON", "python3.10") + } +} + +fn main() { + pyo3_config(); +} \ No newline at end of file