写点 pyo3
This commit is contained in:
parent
bd1bdcbad2
commit
053d126b62
@ -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
19
ica-rs/build.rs
Normal 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user