MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / build_isle

Function build_isle

cranelift/codegen/build.rs:152–189  ·  view source on GitHub ↗
(
    crate_dir: &std::path::Path,
    isle_dir: &std::path::Path,
)

Source from the content-addressed store, hash-verified

150}
151
152fn build_isle(
153 crate_dir: &std::path::Path,
154 isle_dir: &std::path::Path,
155) -> Result<(), Box<dyn std::error::Error + 'static>> {
156 let cur_dir = std::env::current_dir()?;
157 let isle_compilations = meta::isle::get_isle_compilations(
158 &make_isle_source_path_relative(&cur_dir, &crate_dir),
159 &make_isle_source_path_relative(&cur_dir, &isle_dir),
160 );
161
162 let mut had_error = false;
163 for compilation in &isle_compilations.items {
164 for file in &compilation.inputs {
165 println!("cargo:rerun-if-changed={}", file.display());
166 }
167
168 if let Err(e) = run_compilation(compilation) {
169 had_error = true;
170 eprintln!("Error building ISLE files:");
171 eprintln!("{e:?}");
172 #[cfg(not(feature = "isle-errors"))]
173 {
174 eprintln!("To see a more detailed error report, run: ");
175 eprintln!();
176 eprintln!(" $ cargo check -p cranelift-codegen --features isle-errors");
177 eprintln!();
178 }
179 }
180 }
181
182 if had_error {
183 std::process::exit(1);
184 }
185
186 println!("cargo:rustc-env=ISLE_DIR={}", isle_dir.to_str().unwrap());
187
188 Ok(())
189}
190
191/// Build ISLE DSL source text into generated Rust code.
192///

Callers 1

mainFunction · 0.85

Calls 4

get_isle_compilationsFunction · 0.85
run_compilationFunction · 0.85
OkFunction · 0.85

Tested by

no test coverage detected