Skip to content
Snippets Groups Projects
Unverified Commit b0b52100 authored by Carlo Cabrera's avatar Carlo Cabrera
Browse files

extend/ENV/super: allow `O{1,0}` to accept a block

This makes `ENV.O{1,0}` behave like `ENV.deparallelize`.

This should also allow us to build libgcrypt's jitter entropy collector,
which we currently disable because it interacts poorly with our compiler
shims. See #11201.
parent 3cbf7b7e
No related branches found
No related tags found
No related merge requests found
......@@ -338,8 +338,12 @@ module Superenv
end
%w[O1 O0].each do |opt|
define_method opt do
send(:[]=, "HOMEBREW_OPTIMIZATION_LEVEL", opt)
define_method opt do |&block|
if block
with_env(HOMEBREW_OPTIMIZATION_LEVEL: opt) { block.call }
else
send(:[]=, "HOMEBREW_OPTIMIZATION_LEVEL", opt)
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment