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"); }