[libcxx-commits] [libcxxabi] 429a717 - [cmake] Move HandleOutOfTreeLLVM to common cmake utils

John Ericson via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 19 14:05:31 PST 2022


Author: John Ericson
Date: 2022-01-19T22:05:23Z
New Revision: 429a717ea5ec141b5c0c93c2c53097dccf67e05a

URL: https://github.com/llvm/llvm-project/commit/429a717ea5ec141b5c0c93c2c53097dccf67e05a
DIFF: https://github.com/llvm/llvm-project/commit/429a717ea5ec141b5c0c93c2c53097dccf67e05a.diff

LOG: [cmake] Move HandleOutOfTreeLLVM to common cmake utils

This is better than libunwind and libcxxabi fishing it out of libcxx's
module directory.

It is done in prepartion for a better version of D117537 which deduplicates
CMake logic instead of just renaming to avoid a name clash.

Reviewed By: phosek, #libunwind, #libc_abi, Ericson2314

Differential Revision: https://reviews.llvm.org/D117617

Added: 
    cmake/Modules/HandleOutOfTreeLLVM.cmake

Modified: 
    libcxxabi/CMakeLists.txt
    libunwind/CMakeLists.txt

Removed: 
    libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake


################################################################################
diff  --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/cmake/Modules/HandleOutOfTreeLLVM.cmake
similarity index 97%
rename from libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
rename to cmake/Modules/HandleOutOfTreeLLVM.cmake
index 588d48efd412b..edffe572e091e 100644
--- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -1,5 +1,5 @@
 if (NOT DEFINED LLVM_PATH)
-  set(LLVM_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../llvm CACHE PATH "" FORCE)
+  set(LLVM_PATH ${CMAKE_CURRENT_LIST_DIR}/../../llvm CACHE PATH "" FORCE)
 endif()
 
 if(NOT IS_DIRECTORY ${LLVM_PATH})

diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 6b3bcef2851da..78f486418af79 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -37,10 +37,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXXABI_STANDALONE_B
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-bugs at lists.llvm.org")
 
-  # Add the CMake module path of libcxx so we can reuse HandleOutOfTreeLLVM.cmake
-  set(LIBCXXABI_LIBCXX_CMAKE_PATH "${LIBCXXABI_LIBCXX_PATH}/cmake/Modules")
-  list(APPEND CMAKE_MODULE_PATH "${LIBCXXABI_LIBCXX_CMAKE_PATH}")
-
   # In a standalone build, we don't have llvm to automatically generate the
   # llvm-lit script for us.  So we need to provide an explicit directory that
   # the configurator should write the script into.

diff  --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt
index 340a103a4abe8..03bd316d331cb 100644
--- a/libunwind/CMakeLists.txt
+++ b/libunwind/CMakeLists.txt
@@ -37,10 +37,6 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBUNWIND_STANDALONE_B
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-bugs at lists.llvm.org")
 
-  # Add the CMake module path of libcxx so we can reuse HandleOutOfTreeLLVM.cmake
-  set(LIBUNWIND_LIBCXX_CMAKE_PATH "${LIBUNWIND_LIBCXX_PATH}/cmake/Modules")
-  list(APPEND CMAKE_MODULE_PATH "${LIBUNWIND_LIBCXX_CMAKE_PATH}")
-
   # In a standalone build, we don't have llvm to automatically generate the
   # llvm-lit script for us.  So we need to provide an explicit directory that
   # the configurator should write the script into.


        


More information about the libcxx-commits mailing list