Skip to content

Commit a30c580

Browse files
committed
compile_codegen: panic when rustc_codegen_spirv_location is not set
1 parent 30c6502 commit a30c580

File tree

1 file changed

+8
-0
lines changed
  • crates/spirv-builder/src

1 file changed

+8
-0
lines changed

crates/spirv-builder/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ fn dylib_path() -> Vec<PathBuf> {
606606
}
607607
}
608608

609+
#[cfg(feature = "compile_codegen")]
609610
fn find_rustc_codegen_spirv() -> PathBuf {
610611
let filename = format!(
611612
"{}rustc_codegen_spirv{}",
@@ -621,6 +622,13 @@ fn find_rustc_codegen_spirv() -> PathBuf {
621622
panic!("Could not find {filename} in library path");
622623
}
623624

625+
#[cfg(not(feature = "compile_codegen"))]
626+
fn find_rustc_codegen_spirv() -> PathBuf {
627+
panic!(
628+
"Without feature `compile_codegen`, you need to set the path of the codegen dylib using `rustc_codegen_spirv_location(...)`"
629+
);
630+
}
631+
624632
/// Joins strings together while ensuring none of the strings contain the separator.
625633
// NOTE(eddyb) this intentionally consumes the `Vec` to limit accidental misuse.
626634
fn join_checking_for_separators(strings: Vec<impl Borrow<str>>, sep: &str) -> String {

0 commit comments

Comments
 (0)