Split ternary for PATH building into if/else cases

This commit is contained in:
Alex Wang 2018-02-28 09:26:15 -05:00
parent bfa474857a
commit 7b94842610

View File

@ -173,14 +173,32 @@ module Superenv
end
def determine_library_paths
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
else
PATH.new(
keg_only_deps.map(&:opt_lib),
HOMEBREW_PREFIX/"lib",
"#{MacOS.sdk_path}/usr/lib",
(compiler == :llvm_clang ? Formula["llvm"].opt_lib.to_s : ""),
Formula["llvm"].opt_lib.to_s,
homebrew_extra_library_paths,
).existing
end
else
PATH.new(
keg_only_deps.map(&:opt_lib),
HOMEBREW_PREFIX/"lib",
homebrew_extra_library_paths,
).existing
end
end
def determine_dependencies
deps.map(&:name).join(",")