Builds the module. If `print_metadata` is [`MetadataPrintout::Full`], you usually don't have to inspect the path in the result, as the environment variable for the path to the module will already be set.
(mut self)
| 435 | /// Builds the module. If `print_metadata` is [`MetadataPrintout::Full`], you usually don't have to inspect the path |
| 436 | /// in the result, as the environment variable for the path to the module will already be set. |
| 437 | pub fn build(mut self) -> Result<CompileResult, SpirvBuilderError> { |
| 438 | self.validate_running_conditions()?; |
| 439 | let metadata_file = invoke_rustc(&self)?; |
| 440 | match self.print_metadata { |
| 441 | MetadataPrintout::Full | MetadataPrintout::DependencyOnly => { |
| 442 | leaf_deps(&metadata_file, |artifact| { |
| 443 | println!("cargo:rerun-if-changed={artifact}"); |
| 444 | }) |
| 445 | // Close enough |
| 446 | .map_err(SpirvBuilderError::MetadataFileMissing)?; |
| 447 | } |
| 448 | MetadataPrintout::None => (), |
| 449 | } |
| 450 | let metadata = self.parse_metadata_file(&metadata_file)?; |
| 451 | |
| 452 | Ok(metadata) |
| 453 | } |
| 454 | |
| 455 | pub(crate) fn validate_running_conditions(&mut self) -> Result<(), SpirvBuilderError> { |
| 456 | if (self.print_metadata == MetadataPrintout::Full) && self.multimodule { |
no test coverage detected