1[package]
2authors = ["The Cranelift Project Developers"]
3name = "cranelift-codegen"
4version = "0.104.0"
5description = "Low-level code generator library"
6license = "Apache-2.0 WITH LLVM-exception"
7documentation = "https://docs.rs/cranelift-codegen"
8repository = "https://github.com/bytecodealliance/wasmtime"
9categories = ["no-std"]
10readme = "README.md"
11keywords = ["compile", "compiler", "jit"]
12build = "build.rs"
13edition.workspace = true
14
15[lints]
16workspace = true
17
18[dependencies]
19anyhow = { workspace = true, optional = true }
20bumpalo = "3"
21capstone = { workspace = true, optional = true }
22cranelift-codegen-shared = { path = "./shared", version = "0.104.0" }
23cranelift-entity = { workspace = true }
24cranelift-bforest = { workspace = true }
25cranelift-control = { workspace = true }
26hashbrown = { workspace = true, features = ["raw"] }
27target-lexicon = { workspace = true }
28log = { workspace = true }
29serde = { version = "1.0.188", optional = true }
30serde_derive = { version = "1.0.188", optional = true }
31bincode = { version = "1.2.1", optional = true }
32gimli = { workspace = true, features = ["write"], optional = true }
33smallvec = { workspace = true }
34regalloc2 = { workspace = true, features = ["checker"] }
35souper-ir = { version = "2.1.0", optional = true }
36sha2 = { version = "0.10.2", optional = true }
37# It is a goal of the cranelift-codegen crate to have minimal external dependencies.
38# Please don't add any unless they are essential to the task of creating binary
39# machine code. Integration tests that need external dependencies can be
40# accomodated in `tests`.
41
42[dev-dependencies]
43criterion = { version = "0.5.0", features = ["html_reports"] }
44similar = "2.1.0"
45
46[build-dependencies]
47cranelift-codegen-meta = { path = "meta", version = "0.104.0" }
48cranelift-isle = { path = "../isle/isle", version = "=0.104.0" }
49
50[features]
51default = ["std", "unwind", "host-arch", "timing"]
52
53# The "std" feature enables use of libstd. The "core" feature enables use
54# of some minimal std-like replacement libraries. At least one of these two
55# features need to be enabled.
56std = []
57
58# The "core" feature used to enable a hashmap workaround, but is now
59# deprecated (we (i) always use hashbrown, and (ii) don't support a
60# no_std build anymore). The feature remains for backward
61# compatibility as a no-op.
62core = []
63
64# Enable the `to_capstone` method on TargetIsa, for constructing a Capstone
65# context, and the `disassemble` method on `MachBufferFinalized`.
66disas = ["anyhow", "capstone"]
67
68# Enables detailed logging which can be somewhat expensive.
69trace-log = []
70
71# This enables unwind info generation functionality.
72unwind = ["gimli"]
73
74# ISA targets for which we should build.
75# If no ISA targets are explicitly enabled, the ISA target for the host machine is enabled.
76x86 = []
77arm64 = []
78s390x = []
79riscv64 = []
80# Enable the ISA target for the host machine
81host-arch = []
82
83# Option to enable all architectures.
84all-arch = [
85    "x86",
86    "arm64",
87    "s390x",
88    "riscv64"
89]
90
91# For dependent crates that want to serialize some parts of cranelift
92enable-serde = [
93    "serde",
94    "serde_derive",
95    "cranelift-entity/enable-serde",
96    "regalloc2/enable-serde",
97    "smallvec/serde"
98]
99
100# Enable the incremental compilation cache for hot-reload use cases.
101incremental-cache = [
102    "enable-serde",
103    "bincode",
104    "sha2"
105]
106
107# Enable support for the Souper harvester.
108souper-harvest = ["souper-ir", "souper-ir/stringify"]
109
110# Report any ISLE errors in pretty-printed style.
111isle-errors = ["cranelift-isle/fancy-errors"]
112
113# Put ISLE generated files in isle_generated_code/, for easier
114# inspection, rather than inside of target/.
115isle-in-source-tree = []
116
117# Enable tracking how long passes take in Cranelift.
118#
119# Enabled by default.
120timing = []
121
122[[bench]]
123name = "x64-evex-encoding"
124harness = false
125