From 70731b60d4e614f890bc463e0e04060e8a575338 Mon Sep 17 00:00:00 2001 From: tritao Date: Thu, 18 Dec 2025 11:01:05 +0000 Subject: [PATCH] Implement `SWAY_LLVM_NO_OPT`. --- forc-pkg/src/pkg.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/forc-pkg/src/pkg.rs b/forc-pkg/src/pkg.rs index bddec1eb25..4451bc8380 100644 --- a/forc-pkg/src/pkg.rs +++ b/forc-pkg/src/pkg.rs @@ -2395,6 +2395,12 @@ pub fn build_with_options( "LLVM backend produced native executable at {}", native_artifact.display() ); + let skip_llvm_opt = env::var("SWAY_LLVM_NO_OPT") + .map(|val| val != "0" && !val.eq_ignore_ascii_case("false")) + .unwrap_or(false); + if skip_llvm_opt { + continue; + } let opt = env::var("LLVM_OPT").unwrap_or_else(|_| "opt".into()); let opt_ll_path = output_dir .join(format!("{}-opt", pkg_manifest.project.name))