super: refactor LLVM path addition.

This commit is contained in:
Mike McQuaid 2018-03-06 08:44:47 +00:00 committed by GitHub
parent 7b94842610
commit 7cb6ebf3fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,31 +173,22 @@ module Superenv
end
def determine_library_paths
paths = [
keg_only_deps.map(&:opt_lib),
HOMEBREW_PREFIX/"lib",
]
if compiler == :llvm_clang
if MacOS::CLT.installed?
PATH.new(
keg_only_deps.map(&:opt_lib),
HOMEBREW_PREFIX/"lib",
"/usr/lib",
Formula["llvm"].opt_lib.to_s,
homebrew_extra_library_paths,
).existing
paths << "/usr/lib"
else
PATH.new(
keg_only_deps.map(&:opt_lib),
HOMEBREW_PREFIX/"lib",
"#{MacOS.sdk_path}/usr/lib",
Formula["llvm"].opt_lib.to_s,
homebrew_extra_library_paths,
).existing
paths << "#{MacOS.sdk_path}/usr/lib"
end
else
PATH.new(
keg_only_deps.map(&:opt_lib),
HOMEBREW_PREFIX/"lib",
homebrew_extra_library_paths,
).existing
paths << Formula["llvm"].opt_lib.to_s
end
paths << homebrew_extra_library_paths
PATH.new(paths).existing
end
def determine_dependencies