Prefer using LLVM_PREFIX if available to find clang and llvm-link programs #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR, when specifying a
LLVM_PREFIX
, it is not used to determine theCLANG_PATH
and theLLVMLINK_PATH
, if these binaries are available system-wide.After this PR, if
LLVM_PREFIX
has been specified, only this variable is used to determineCLANG_PATH
andLLVMLINK_PATH
. If it hasn't been specified, the lookup code is unchanged.Depending on the precise semantics attached to
LLVM_PREFIX
, this may or may be the wanted behavior. Alternatively, we could first check only looking at theLLVM_PREFIX
path, and then the other paths if not found.The method I chose has the property that the user cannot accidentally have a
CLANG_PATH
orLLVMLINK_PATH
not matching theirLLVM_PREFIX
.I chose this method because I believe that when the
LLVM_PREFIX
is specified, it precisely conveys the intent to use it, and so it should completely replace the system paths.I can change this PR if this is not the wanted behavior.