Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bindings/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ links = "blst"
# Binary can be executed on systems similar to the host.
default = ["std"]
# When compiled without this feature library is `no_std` compatible
std = []
std = ["dep:threadpool"]
# Compile in portable mode, without ISA extensions.
# Binary can be executed on all systems.
portable = []
Expand All @@ -48,7 +48,7 @@ glob = "0.3"
zeroize = { version = "^1.1", features = ["zeroize_derive"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
threadpool = "^1.8.1"
threadpool = { version = "^1.8.1", optional = true }

[dev-dependencies]
rand = "0.7"
Expand Down
3 changes: 2 additions & 1 deletion bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fn assembly(file_vec: &mut Vec<PathBuf>, base_dir: &Path, _arch: &String) {
fn main() {
// account for cross-compilation [by examining environment variable]
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();

if target_arch.eq("wasm32") {
println!("cargo:rustc-cfg=feature=\"no-threads\"");
Expand Down Expand Up @@ -131,7 +132,7 @@ fn main() {
.flag_if_supported("-fno-builtin")
.flag_if_supported("-Wno-unused-function")
.flag_if_supported("-Wno-unused-command-line-argument");
if target_arch.eq("wasm32") {
if target_arch.eq("wasm32") || target_os.eq("none") {
cc.flag_if_supported("-ffreestanding");
}
if !cfg!(debug_assertions) {
Expand Down