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