Merge pull request #10566 from MikeMcQuaid/undeprecate-env-O

Undeprecate ENV.O1/ENV.O0
This commit is contained in:
Mike McQuaid 2021-02-08 11:48:50 +00:00 committed by GitHub
commit 1d486249a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -238,7 +238,6 @@ module SharedEnvExtension
# Snow Leopard defines an NCURSES value the opposite of most distros.
# @see https://bugs.python.org/issue6848
# Currently only used by aalib in core.
sig { void }
def ncurses_define
odeprecated "ENV.ncurses_define"

View File

@ -97,7 +97,7 @@ module Stdenv
old
end
%w[O3 O2 O1 O0 Os].each do |opt|
%w[O3 O2 Os].each do |opt|
define_method opt do
odisabled "ENV.#{opt}"
@ -106,6 +106,13 @@ module Stdenv
end
end
%w[O1 O0].each do |opt|
define_method opt do
send(:remove_from_cflags, /-O./)
send(:append_to_cflags, "-#{opt}")
end
end
sig { returns(T.any(String, Pathname)) }
def determine_cc
s = super

View File

@ -344,7 +344,7 @@ module Superenv
append_to_cccfg "O"
end
%w[O3 O2 O1 O0 Os].each do |opt|
%w[O3 O2 Os].each do |opt|
define_method opt do
odisabled "ENV.#{opt}"
@ -352,6 +352,12 @@ module Superenv
end
end
%w[O1 O0].each do |opt|
define_method opt do
send(:[]=, "HOMEBREW_OPTIMIZATION_LEVEL", opt)
end
end
sig { void }
def set_x11_env_if_installed
odisabled "ENV.set_x11_env_if_installed"