Fix default_cc

Dumb logic error. Also same one in MacOS.compiler. Am I getting old?

Also it returns a string and not a float.
This commit is contained in:
Max Howell 2012-02-16 19:26:31 +00:00
parent a69ec7a22b
commit e7466c5b33

View File

@ -267,13 +267,11 @@ module MacOS extend self
end end
def default_cc def default_cc
cc = if !File.file? "/usr/bin/cc" and xcode_version > 4.3 cc = Pathname.new("#{dev_tools_path}/cc")
# there is no cc file in Xcode 4.3.0 in the /Developer/usr/bin directory # Xcode 4.3.0 has no /Applications/Xcode/Contents/Developer/usr/bin/cc
"llvm-gcc" # Xcode 4.3.0 has no GCC
else cc = Pathname.new("#{dev_tools_path}/llvm-gcc") unless cc.file?
"cc" cc.realpath.basename.to_s
end
Pathname.new("#{dev_tools_path}/cc").realpath.basename.to_s
end end
def default_compiler def default_compiler
@ -283,7 +281,7 @@ module MacOS extend self
when "clang" then :clang when "clang" then :clang
else else
# guess :( # guess :(
if xcode_version > 4.2 if xcode_version >= "4.2"
:llvm :llvm
else else
:gcc :gcc