Don't call xcrun twice

This commit is contained in:
Jack Nagel 2014-04-15 11:25:00 -05:00
parent 2f052a2f65
commit b78a4b7372

View File

@ -60,10 +60,9 @@ module OS
elsif tools_in_prefix? "/" elsif tools_in_prefix? "/"
# probably a safe enough assumption (the unix way) # probably a safe enough assumption (the unix way)
Pathname.new "/usr/bin" Pathname.new "/usr/bin"
elsif not `/usr/bin/xcrun -find make 2>/dev/null`.empty? elsif not (make_path = `/usr/bin/xcrun -find make 2>/dev/null`).empty?
# Note that the exit status of system "xcrun foo" isn't always accurate # Note that the exit status of system "xcrun foo" isn't always accurate
# Wherever "make" is there are the dev tools. Pathname.new(make_path.chomp).dirname
Pathname.new(`/usr/bin/xcrun -find make`.chomp).dirname
elsif File.exist? "#{Xcode.prefix}/usr/bin/make" elsif File.exist? "#{Xcode.prefix}/usr/bin/make"
# cc stopped existing with Xcode 4.3, there are c89 and c99 options though # cc stopped existing with Xcode 4.3, there are c89 and c99 options though
Pathname.new "#{Xcode.prefix}/usr/bin" Pathname.new "#{Xcode.prefix}/usr/bin"