[PATCH] D62640: [CMake] Use find_package(LLVM) instead of LLVMConfig

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 00:12:50 PDT 2019


phosek marked an inline comment as done.
phosek added inline comments.


================
Comment at: llvm/runtimes/CMakeLists.txt:62
 
+  find_package(LLVM)
+
----------------
smeenai wrote:
> `CMAKE_PREFIX_PATH` won't work correctly when `CMAKE_FIND_ROOT_PATH` is used and `CMAKE_FIND_ROOT_PATH_MODE_PACKAGE` is set to `ONLY`, which is a fairly common configuration for cross-compilation. Setting `LLVM_DIR` explicitly to `${LLVM_BINARY_DIR}/lib/cmake/llvm` should always work. You could combine that with `NO_DEFAULT_PATH` to ensure you only search in the specified directory, unless you want to be able to find some other LLVM package that's installed on the system?
I've used `find_package(LLVM PATHS ...)`, is that what you had in mind?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62640/new/

https://reviews.llvm.org/D62640





More information about the llvm-commits mailing list