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