Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion crates/spirv-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pub struct SpirvBuilder {
print_metadata: MetadataPrintout,
release: bool,
target: String,
deny_warnings: bool,
bindless: bool,
multimodule: bool,
name_variables: bool,
Expand All @@ -170,6 +171,7 @@ impl SpirvBuilder {
print_metadata: MetadataPrintout::Full,
release: true,
target: target.into(),
deny_warnings: false,
bindless: false,
multimodule: false,
name_variables: false,
Expand All @@ -191,6 +193,11 @@ impl SpirvBuilder {
self
}

pub fn deny_warnings(mut self, v: bool) -> Self {
self.deny_warnings = v;
self
}

/// Run the compiler in bindless mode, this flag is in preparation for the full feature
/// and it's expected to be the default mode going forward
pub fn bindless(mut self, v: bool) -> Self {
Expand Down Expand Up @@ -431,12 +438,19 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
format!(" -C target-feature={}", target_features.join(","))
};

let deny_warnings = if builder.deny_warnings {
" -D warnings"
} else {
""
};

//FIXME: reintroduce v0 mangling, see issue #642
let rustflags = format!(
"-Z codegen-backend={} -Zsymbol-mangling-version=legacy{}{}",
"-Z codegen-backend={} -Zsymbol-mangling-version=legacy{}{}{}",
rustc_codegen_spirv.display(),
feature_flag,
llvm_args,
deny_warnings,
);

let mut cargo = Command::new("cargo");
Expand Down