mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
Add option to treat warnings as errors (#683)
This commit is contained in:
parent
22e4bf4022
commit
428824be94
@ -148,6 +148,7 @@ pub struct SpirvBuilder {
|
||||
print_metadata: MetadataPrintout,
|
||||
release: bool,
|
||||
target: String,
|
||||
deny_warnings: bool,
|
||||
bindless: bool,
|
||||
multimodule: bool,
|
||||
name_variables: bool,
|
||||
@ -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,
|
||||
@ -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 {
|
||||
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user