From 23f7dcba5c9e61b632149ac15a6fb3931f68b28f Mon Sep 17 00:00:00 2001 From: Yaroslav Yashin Date: Thu, 12 Dec 2024 16:46:35 +0100 Subject: [PATCH] Slightly fixed shaders building pipeline Previously it included debug symbols unconditionally. --- mopro-msm/Cargo.toml | 1 + mopro-msm/build.rs | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/mopro-msm/Cargo.toml b/mopro-msm/Cargo.toml index 8557e45..11f3639 100644 --- a/mopro-msm/Cargo.toml +++ b/mopro-msm/Cargo.toml @@ -9,6 +9,7 @@ default = ["macos"] macos = [] ios = [] +profiling-release = [] [dependencies] ## Shared dependencies diff --git a/mopro-msm/build.rs b/mopro-msm/build.rs index fc92c91..c6e9d4f 100644 --- a/mopro-msm/build.rs +++ b/mopro-msm/build.rs @@ -25,16 +25,12 @@ fn compile_shaders() { get_sdk(), "metal", "-c", - "-frecord-sources", shader_path.to_str().unwrap(), "-o", air_output.to_str().unwrap(), ]; - if std::env::var("PROFILE") - .map(|profile| profile == "release") - .unwrap_or(false) - { + if cfg!(feature = "profiling-release") { args.push("-frecord-sources"); } @@ -62,10 +58,7 @@ fn compile_shaders() { metallib_output.to_str().unwrap(), ]; - if std::env::var("PROFILE") - .map(|profile| profile == "release") - .unwrap_or(false) - { + if cfg!(feature = "profiling-release") { metallib_args.push("-frecord-sources"); }