ruby/Cargo.toml
Alan Wu 92b218fbc3 YJIT: ZJIT: Allow both JITs in the same build
This commit allows building YJIT and ZJIT simultaneously, a "combo
build". Previously, `./configure --enable-yjit --enable-zjit` failed. At
runtime, though, only one of the two can be enabled at a time.

Add a root Cargo workspace that contains both the yjit and zjit crate.
The common Rust build integration mechanisms are factored out into
defs/jit.mk.

Combo YJIT+ZJIT dev builds are supported; if either JIT uses
`--enable-*=dev`, both of them are built in dev mode.

The combo build requires Cargo, but building one JIT at a time with only
rustc in release build remains supported.
2025-05-15 00:39:03 +09:00

51 lines
1.2 KiB
TOML

# Using Cargo's workspace feature to build all the Rust code in
# into a single package.
# TODO(alan) notes about rust version requirements. Undecided yet.
[workspace]
members = ["zjit", "yjit"]
[package]
name = "jit"
version = "0.0.0"
edition = "2024"
rust-version = "1.85.0"
publish = false # Don't publish to crates.io
[dependencies]
yjit = { path = "yjit", optional = true }
zjit = { path = "zjit", optional = true }
[lib]
crate-type = ["staticlib"]
path = "jit.rs"
[features]
disasm = []
runtime_checks = []
yjit = [ "dep:yjit" ]
zjit = [ "dep:zjit" ]
[profile.dev]
opt-level = 0
debug = true
debug-assertions = true
overflow-checks = true
[profile.dev_nodebug]
inherits = "dev"
[profile.stats]
inherits = "release"
[profile.release]
# NOTE: --enable-yjit and zjit builds use `rustc` without going through Cargo. You
# might want to update the `rustc` invocation if you change this profile.
opt-level = 3
# The extra robustness that comes from checking for arithmetic overflow is
# worth the performance cost for the compiler.
overflow-checks = true
# Generate debug info
debug = true
# Use ThinLTO. Much smaller output for a small amount of build time increase.
lto = "thin"