diff --git a/glsl-to-spirv/build/build.rs b/glsl-to-spirv/build/build.rs index 6e5395b2..db6ad767 100644 --- a/glsl-to-spirv/build/build.rs +++ b/glsl-to-spirv/build/build.rs @@ -1,5 +1,6 @@ use std::env; use std::fs; +use std::fs::Permissions; use std::path::Path; fn main() { @@ -21,5 +22,15 @@ fn main() { fs::copy(&path, &out_file).unwrap(); } - //fs::set_permissions(&out_file, std::io::USER_EXEC).unwrap(); + // setting permissions of the executable + { + #[cfg(linux)] fn permissions() -> Option { + use std::os::unix::fs::PermissionsExt; + Some(Permissions::from_mode(755)) + } + #[cfg(not(linux))] fn permissions() -> Option { None } + if let Some(permissions) = permissions() { + fs::set_permissions(&out_file, permissions).unwrap(); + } + } }