Warn about removed warnings less shockingly

The problem here now is though that the warnings only appear when compiling verbosely. But they should thus be visible if the build fails. Or if people are hunting for problems.
This commit is contained in:
Max Howell 2012-08-29 15:19:42 -04:00
parent 466a240bbe
commit a7946e0088
2 changed files with 7 additions and 12 deletions

View File

@ -106,6 +106,13 @@ class Cmd
args << arg args << arg
end end
end end
rms = @args - args
%w{CPPFLAGS LDFLAGS CXXFLAGS CFLAGS}.each do |flag|
unison = ENV[flag].split(' ') & rms
puts "Warning! #{unison*' '} removed from #{flag.upcase} by superenv" unless unison.empty?
end
args args
end end
def cflags def cflags
@ -135,10 +142,6 @@ end
####################################################################### sanity ####################################################################### sanity
abort "The build-tool has reset ENV. --lame-env required." unless ENV['HOMEBREW_BREW_FILE'] abort "The build-tool has reset ENV. --lame-env required." unless ENV['HOMEBREW_BREW_FILE']
%w{CPPFLAGS LDFLAGS CXXFLAGS CFLAGS}.each do |flag|
puts "#{flag} set but superenv running! Flags may be removed!" if ENV[flag]
end
######################################################################### main ######################################################################### main
cmd = Cmd.new($0, ARGV) cmd = Cmd.new($0, ARGV)
exec "xcrun", cmd.tool, *cmd.args exec "xcrun", cmd.tool, *cmd.args

View File

@ -85,14 +85,6 @@ def install f
ENV.deps = keg_only_deps.map(&:to_s) ENV.deps = keg_only_deps.map(&:to_s)
ENV.x11 = f.requirements.detect{|rq| rq.class == X11Dependency } ENV.x11 = f.requirements.detect{|rq| rq.class == X11Dependency }
ENV.setup_build_environment ENV.setup_build_environment
class << ENV
def []=(key, value)
case key when 'CFLAGS', 'CPPFLAGS', 'LDFAGS'
opoo "#{key} set with --env=super! Flags may not take effect!"
end
store(key, value)
end
end
end end
f.recursive_requirements.each { |req| req.modify_build_environment } f.recursive_requirements.each { |req| req.modify_build_environment }