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.
This commit is contained in:
parent
3cbf7b7e9e
commit
b0b521001e
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user