extend/ENV/super: add ENV.O3

Having this would have been, or would be, useful on multiple occassions:

- Homebrew/homebrew-core#94724
- Homebrew/homebrew-core#136551
- #15372

I think it's time that we added this back.
This commit is contained in:
Carlo Cabrera 2023-07-14 14:35:39 +08:00
parent e9ac36a542
commit 91fe645750
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -375,6 +375,15 @@ module Superenv
self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O1"
end
end
sig { params(block: T.nilable(T.proc.void)).void }
def O3(&block)
if block
with_env(HOMEBREW_OPTIMIZATION_LEVEL: "O3", &block)
else
self["HOMEBREW_OPTIMIZATION_LEVEL"] = "O3"
end
end
# rubocop: enable Naming/MethodName
end