mirror of
http://shenjack.top:5100/shenjack/icalingua-python-bot.git
synced 2024-11-23 20:45:06 +08:00
写点 pyo3
This commit is contained in:
parent
bd1bdcbad2
commit
053d126b62
|
@ -2,6 +2,7 @@
|
||||||
name = "ica-rs"
|
name = "ica-rs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
build = "build.rs"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# 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]
|
[patch.crates-io]
|
||||||
rust_socketio = { path = "../../../rust-socketio/socketio" }
|
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