[Lldb-commits] [PATCH] D64823: [CMake] Default LLDB_PATH_TO_LLVM_BUILD to LLVM_DIR
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 16 14:37:13 PDT 2019
JDevlieghere created this revision.
JDevlieghere added reviewers: sgraenitz, mgorny, xiaobai.
Herald added a subscriber: abidh.
Herald added a project: LLDB.
When doing a standalone build, without setting `LLDB_PATH_TO_LLVM_BUILD` or `LLDB_PATH_TO_CLANG_BUILD`, you get the following error.
CMake Error at cmake/modules/LLDBStandalone.cmake:23 (find_package):
Could not find a package configuration file provided by "LLVM" with any of
the following names:
LLVMConfig.cmake
llvm-config.cmake
Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
"LLVM_DIR" to a directory containing one of the above files. If "LLVM"
provides a separate development package or SDK, be sure it has been
installed.
This suggests setting `LLVM_DIR` to LLVM's install directory. However, LLDBStandalone.cmake takes `LLDB_PATH_TO_LLVM_BUILD` as its hint. As someone who isn't familiar with the standalone process, this is rather confusing. I assume there's good reason to use a separate variable here, so I didn't want to change that. Instead, I propose using `LLVM_DIR` as the default for `LLDB_PATH_TO_LLVM_BUILD`. That way, passing `-DLLVM_DIR=/path/to/llvm` is sufficient to get the standalone build working.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D64823
Files:
lldb/cmake/modules/LLDBStandalone.cmake
Index: lldb/cmake/modules/LLDBStandalone.cmake
===================================================================
--- lldb/cmake/modules/LLDBStandalone.cmake
+++ lldb/cmake/modules/LLDBStandalone.cmake
@@ -14,7 +14,7 @@
option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
- set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH "Path to LLVM build tree")
+ set(LLDB_PATH_TO_LLVM_BUILD "${LLVM_DIR}" CACHE PATH "Path to LLVM build tree")
set(LLDB_PATH_TO_CLANG_BUILD "${LLDB_PATH_TO_LLVM_BUILD}" CACHE PATH "Path to Clang build tree")
file(TO_CMAKE_PATH "${LLDB_PATH_TO_LLVM_BUILD}" LLDB_PATH_TO_LLVM_BUILD)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64823.210181.patch
Type: text/x-patch
Size: 657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190716/aeb3ffd5/attachment.bin>
More information about the lldb-commits
mailing list