[Lldb-commits] [PATCH] D57402: build: remove custom variables

Saleem Abdulrasool via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 29 10:53:23 PST 2019


compnerd created this revision.
compnerd added reviewers: zturner, xiaobai, sgraenitz, labath.
Herald added subscribers: teemperor, mgorny.

Prefer the standard CMake behaviour of using `<project>_DIR` variables to indicate where to find the CMake configurations.  This allows implicit use of the system provided packages (which is in the default CMake search path) or the user may specify the value and have CMake use the specified build.  There is no need for special behaviour specific to LLDB.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D57402

Files:
  cmake/modules/LLDBStandalone.cmake


Index: cmake/modules/LLDBStandalone.cmake
===================================================================
--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -5,16 +5,8 @@

   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_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)
-  file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_BUILD}" LLDB_PATH_TO_CLANG_BUILD)
-
-  find_package(LLVM REQUIRED CONFIG
-    HINTS "${LLDB_PATH_TO_LLVM_BUILD}" NO_CMAKE_FIND_ROOT_PATH)
-  find_package(Clang REQUIRED CONFIG
-    HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_CMAKE_FIND_ROOT_PATH)
+  find_package(LLVM REQUIRED CONFIG NO_CMAKE_FIND_ROOT_PATH)
+  find_package(Clang REQUIRED CONFIG NO_CMAKE_FIND_ROOT_PATH)

   # We set LLVM_CMAKE_PATH so that GetSVN.cmake is found correctly when building SVNVersion.inc
   set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules")
@@ -26,7 +18,7 @@
   set(LLVM_DEFAULT_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")

   if(CMAKE_CROSSCOMPILING)
-    set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")
+    set(LLVM_NATIVE_BUILD "${LLVM_BINARY_DIR}/NATIVE")
     if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
       message(FATAL_ERROR
         "Attempting to cross-compile LLDB standalone but no native LLVM build


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57402.184125.patch
Type: text/x-patch
Size: 1562 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190129/f9f82d16/attachment.bin>


More information about the lldb-commits mailing list