(
crate_dir: &std::path::Path,
isle_dir: &std::path::Path,
)
| 150 | } |
| 151 | |
| 152 | fn 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 | /// |
no test coverage detected