If LLDB_PATH_TO_LLVM_BUILD is present, search for llvm-config there first before looking in CMake or system paths.
(The patch is a modified fix from @tfiala)
tfiala on Oct 20 2016, 9:05 AM.Authored by
LLDB_PATH_TO_LLVM_BUILD is a swift-ism that doesn't match LLVM's CMake conventions. In LLVM we don't pass in the path to build directories, instead we pass in LLVM_CONFIG to standalone builds, and we derive the build directory from the output of llvm-config.
Passing in LLVM_CONFIG is more flexible, robust, and consistent with how other LLVM subprojects work, and I see no reason to change that convention.
I agree. Don't introduce redundant variables when the same result can be achieved using existing means.
(note that find_program makes LLVM_CONFIG a cache variable implicity, so you don't need to have any explicit support for altering it)