#[non_exhaustive]pub struct BuildScriptConfig {
pub defaults: bool,
pub dependency_info: Option<bool>,
pub env_shader_spv_path: Option<bool>,
pub forward_rustc_warnings: Option<bool>,
pub cargo_color_always: Option<bool>,
}Expand description
Configuration for build scripts
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.defaults: boolEnable this if you are using spirv-builder from a build script to apply some recommended default options, such
as Self::dependency_info, Self::forward_rustc_warnings and Self::cargo_color_always.
dependency_info: Option<bool>Print dependency information for cargo build scripts (with cargo::rerun-if-changed={} and such).
Dependency information makes cargo rerun the build script is rerun when shader source files change, thus
rebuilding the shader.
Default: Self::defaults
env_shader_spv_path: Option<bool>Whether to emit an env var pointing to the shader module file (via cargo::rustc-env={}). The name of the env
var is the crate name with .spv appended, e.g. sky_shader.spv.
Not supported together with multimodule=true.
Some examples on how to include the shader module in the source code:
- wgpu:
let shader: ShaderModuleDescriptorPassthrough = include_spirv_raw!(env!("my_shader.spv"));- ash
let bytes: &[u8] = include_bytes!(env!("my_shader.spv"))
let words = ash::util::read_spv(&mut std::io::Cursor::new(bytes)).unwrap();Default: false
forward_rustc_warnings: Option<bool>Forwards any warnings or errors by rustc as build script warnings (via cargo::warning=). Not enabling this
option may hide warnings if the build succeeds.
Default: Self::defaults
cargo_color_always: Option<bool>Pass --color always to cargo to force enable colorful error messages. Particularly in build scripts, these
are disabled by default, even though we’ll forward them to your console. Should your console not support colors,
then the outer cargo executing the build script will filter out all ansi escape sequences anyway, so we’re free
to always emit them.
Default: Self::defaults
Trait Implementations§
Source§impl Clone for BuildScriptConfig
impl Clone for BuildScriptConfig
Source§fn clone(&self) -> BuildScriptConfig
fn clone(&self) -> BuildScriptConfig
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more