Decouple detect_stdlibs from ENV

I want to decouple from the global ENV constant as much as possible so
that eventually we can change the build environment implementation.
detect_stdlibs only cares about the compiler, not the whole ENV.
This commit is contained in:
Jack Nagel 2015-06-25 23:42:54 -04:00
parent d864708271
commit e40b735217

View File

@ -128,7 +128,7 @@ class Build
formula.install
stdlibs = detect_stdlibs
stdlibs = detect_stdlibs(ENV.compiler)
Tab.create(formula, ENV.compiler, stdlibs.first, formula.build).write
# Find and link metafiles
@ -138,9 +138,9 @@ class Build
end
end
def detect_stdlibs
def detect_stdlibs(compiler)
keg = Keg.new(formula.prefix)
CxxStdlib.check_compatibility(formula, deps, keg, ENV.compiler)
CxxStdlib.check_compatibility(formula, deps, keg, compiler)
# The stdlib recorded in the install receipt is used during dependency
# compatibility checks, so we only care about the stdlib that libraries