写点 pyo3

This commit is contained in:
shenjack 2024-01-24 14:29:31 +08:00
parent bd1bdcbad2
commit 053d126b62
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 23 additions and 0 deletions

View File

@ -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]

19
ica-rs/build.rs Normal file
View File

@ -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();
}