Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I suggest this may be an options when LLVM_CONFIG is not specified.
CMakeLists.txt | ||
---|---|---|
36 ↗ | (On Diff #96859) | Could we move find_package(LLVM) into here? |
Comment Actions
I have investigated what LLVMConfig.cmake actually provides.
With the installed tree, SRC_ROOT (LLVM_BUILD_MAIN_SRC_DIR) is not provided.
It shouldn't be included in installed LLVMConfig.cmake. Just "llvm-config --src-root" knows. And LLVM_MAIN_SRC_DIR should be CACHE, optional to be specified manually.
I suggest;
- Invoke "llvm-config --cmakedir --src-root" if LLVM_CONFIG is specified. (may be removed in future) Do not override LLVM_MAIN_SRC_DIR if it is defined.
- find_package(LLVM REQUIRED HINTS ${LLVM_CMAKE_PATH}). Without LLVM_CONFIG, CMake will seek LLVMConfig.cmake along CMake's search paths like -DCMAKE_PREFIX_PATH.
- If LLVM_MAIN_SRC_DIR is unknown, invoke "llvm-config --src-root"
LLVM_MAIN_SRC_DIR is just required to build test tools in llvm/utils.
Comment Actions
This is my eventual goal, but for now this is just a NFC clean up to make future changes more simple.