Move xctoolchain_path to Xcode module, where it belongs
This commit is contained in:
parent
564b5df261
commit
71055aa073
@ -71,9 +71,7 @@ module Stdenv
|
||||
macosxsdk MacOS.version
|
||||
|
||||
if MacOS::Xcode.without_clt?
|
||||
# Some tools (clang, etc.) are in the xctoolchain dir of Xcode
|
||||
append_path 'PATH', "#{MacOS.xctoolchain_path}/usr/bin" if MacOS.xctoolchain_path
|
||||
# Others are now at /Applications/Xcode.app/Contents/Developer/usr/bin
|
||||
append_path "PATH", "#{MacOS::Xcode.toolchain_path}/usr/bin"
|
||||
append_path 'PATH', MacOS.dev_tools_path
|
||||
end
|
||||
end
|
||||
|
@ -117,7 +117,7 @@ module Superenv
|
||||
paths = [Superenv.bin]
|
||||
if MacOS::Xcode.without_clt?
|
||||
paths << "#{MacOS::Xcode.prefix}/usr/bin"
|
||||
paths << "#{MacOS::Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain/usr/bin"
|
||||
paths << "#{MacOS::Xcode.toolchain_path}/usr/bin"
|
||||
end
|
||||
paths += deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/bin" }
|
||||
paths << MacOS::X11.bin if x11?
|
||||
|
@ -56,16 +56,6 @@ module OS
|
||||
%w{cc make}.all? { |tool| File.executable? "#{prefix}/usr/bin/#{tool}" }
|
||||
end
|
||||
|
||||
def xctoolchain_path
|
||||
# As of Xcode 4.3, some tools are located in the "xctoolchain" directory
|
||||
@xctoolchain_path ||= begin
|
||||
path = Pathname.new("#{Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain")
|
||||
# If only the CLT are installed, all tools will be under dev_tools_path,
|
||||
# this path won't exist, and xctoolchain_path will be nil.
|
||||
path if path.exist?
|
||||
end
|
||||
end
|
||||
|
||||
def sdk_path(v = version)
|
||||
(@sdk_path ||= {}).fetch(v.to_s) do |key|
|
||||
opts = []
|
||||
|
@ -61,6 +61,10 @@ module OS
|
||||
end
|
||||
end
|
||||
|
||||
def toolchain_path
|
||||
Pathname.new("#{prefix}/Toolchains/XcodeDefault.xctoolchain") if installed? && version >= "4.3"
|
||||
end
|
||||
|
||||
# Ask Spotlight where Xcode is. If the user didn't install the
|
||||
# helper tools and installed Xcode in a non-conventional place, this
|
||||
# is our only option. See: http://superuser.com/questions/390757
|
||||
|
Loading…
x
Reference in New Issue
Block a user