Allow building without std (#1069)
Closes https://github.com/CraneStation/cranelift/issues/1067
This commit is contained in:
committed by
Benjamin Bouvier
parent
40f6d3b753
commit
a1f6457e8a
@@ -13,14 +13,14 @@ edition = "2018"
|
||||
[dependencies]
|
||||
cranelift-codegen = { path = "../cranelift-codegen", version = "0.44.0", default-features = false }
|
||||
cranelift-entity = { path = "../cranelift-entity", version = "0.44.0", default-features = false }
|
||||
hashmap_core = { version = "0.1.9", optional = true }
|
||||
hashbrown = { version = "0.6", optional = true }
|
||||
failure = { version = "0.1.1", default-features = false }
|
||||
log = { version = "0.4.6", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["cranelift-codegen/std", "cranelift-entity/std"]
|
||||
core = ["hashmap_core", "cranelift-codegen/core"]
|
||||
core = ["hashbrown", "cranelift-codegen/core"]
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "experimental" }
|
||||
|
||||
@@ -28,7 +28,7 @@ extern crate alloc as std;
|
||||
extern crate std;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use hashmap_core::{map as hash_map, HashMap};
|
||||
use hashbrown::{hash_map, HashMap};
|
||||
#[cfg(feature = "std")]
|
||||
use std::collections::{hash_map, HashMap};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user