Skip to content

Commit

Permalink
cranelift: expand umbrella crate with more crates (bytecodealliance#8634
Browse files Browse the repository at this point in the history
)

* cranelift: expand umbrella crate with more crates

* Break the dependency cycle between cranelift-jit and cranelift

---------

Co-authored-by: Trevor Elliott <telliott@fastly.com>
  • Loading branch information
2 people authored and alexcrichton committed May 20, 2024
1 parent 308c799 commit 000b5b7
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cranelift/jit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ selinux-fix = ['memmap2']
default = []

[dev-dependencies]
cranelift = { workspace = true }
cranelift = { path = "../umbrella" }
cranelift-frontend = { workspace = true }
cranelift-entity = { workspace = true }
27 changes: 23 additions & 4 deletions cranelift/umbrella/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,28 @@ edition.workspace = true

[dependencies]
cranelift-codegen = { workspace = true }
cranelift-frontend = { workspace = true }
cranelift-frontend = { workspace = true, optional = true }
cranelift-interpreter = { workspace = true, optional = true }
cranelift-jit = { workspace = true, optional = true }
cranelift-module = { workspace = true, optional = true }
cranelift-native = { workspace = true, optional = true }
cranelift-object = { workspace = true, optional = true }

[features]
default = ["std"]
std = ["cranelift-codegen/std", "cranelift-frontend/std"]
core = ["cranelift-codegen/core", "cranelift-frontend/core"]
default = ["std", "frontend"]
frontend = ["dep:cranelift-frontend"]
interpreter = ["dep:cranelift-interpreter"]
jit = ["dep:cranelift-jit"]
module = ["dep:cranelift-module"]
native = ["dep:cranelift-native"]
object = ["dep:cranelift-object"]
std = [
"cranelift-codegen/std",
"cranelift-frontend?/std",
"cranelift-module?/std",
]
core = [
"cranelift-codegen/core",
"cranelift-frontend?/core",
"cranelift-module?/core",
]
12 changes: 12 additions & 0 deletions cranelift/umbrella/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@

/// Provide these crates, renamed to reduce stutter.
pub use cranelift_codegen as codegen;
#[cfg(feature = "frontend")]
pub use cranelift_frontend as frontend;
#[cfg(feature = "interpreter")]
pub use cranelift_interpreter as interpreter;
#[cfg(feature = "jit")]
pub use cranelift_jit as jit;
#[cfg(feature = "module")]
pub use cranelift_module as module;
#[cfg(feature = "native")]
pub use cranelift_native as native;
#[cfg(feature = "object")]
pub use cranelift_object as object;

/// A prelude providing convenient access to commonly-used cranelift features. Use
/// as `use cranelift::prelude::*`.
Expand All @@ -22,6 +33,7 @@ pub mod prelude {
pub use crate::codegen::isa;
pub use crate::codegen::settings::{self, Configurable};

#[cfg(feature = "frontend")]
pub use crate::frontend::{FunctionBuilder, FunctionBuilderContext, Variable};
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const CRATES_TO_PUBLISH: &[&str] = &[
"cranelift-native",
"cranelift-object",
"cranelift-interpreter",
"cranelift",
"wasmtime-jit-icache-coherence",
"cranelift-jit",
"cranelift",
// wiggle
"wiggle-generate",
"wiggle-macro",
Expand Down

0 comments on commit 000b5b7

Please sign in to comment.