[flang-commits] [flang] b3af9fb - Set the path to the shared cmake modules based on the llvm directory

John Ericson via flang-commits flang-commits at lists.llvm.org
Sat Jan 1 09:59:12 PST 2022


Author: John Ericson
Date: 2022-01-01T17:59:08Z
New Revision: b3af9fbcc908c3a4b0fae721fa5102459070db83

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

LOG: Set the path to the shared cmake modules based on the llvm directory

It’s still possible to build parts of the main llvm build (lld, clang etc) by symlinking them into llvm/tools.

Reviewed By: Ericson2314

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

Added: 
    

Modified: 
    flang/CMakeLists.txt
    lld/CMakeLists.txt
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index 64852fcd1a982..abb9a47d3abb4 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -227,10 +227,14 @@ include_directories(BEFORE
   ${FLANG_BINARY_DIR}/include
   ${FLANG_SOURCE_DIR}/include)
 
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${FLANG_SOURCE_DIR}/../cmake)
+endif()
+
 # Add Flang-centric modules to cmake path.
 list(INSERT CMAKE_MODULE_PATH 0
   "${FLANG_SOURCE_DIR}/cmake/modules"
-  "${FLANG_SOURCE_DIR}/../cmake/Modules"
+  "${LLVM_COMMON_CMAKE_UTILS}/Modules"
   )
 include(AddFlang)
 

diff  --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 00f8e1bb2a779..881f16cc0aba6 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -153,10 +153,14 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
 "`CMakeFiles'. Please delete them.")
 endif()
 
+if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
+  set(LLVM_COMMON_CMAKE_UTILS ${LLD_SOURCE_DIR}/../cmake)
+endif()
+
 # Add path for custom modules.
 list(INSERT CMAKE_MODULE_PATH 0
   "${LLD_SOURCE_DIR}/cmake/modules"
-  "${LLD_SOURCE_DIR}/../cmake/Modules"
+  "${LLVM_COMMON_CMAKE_UTILS}/Modules"
   )
 
 include(AddLLD)

diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 06aca534bd748..5d6079c4c83d5 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -308,6 +308,7 @@ set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include ) # --includedir
 set(LLVM_BINARY_DIR       ${CMAKE_CURRENT_BINARY_DIR}  ) # --prefix
 
 set(LLVM_THIRD_PARTY_DIR  ${CMAKE_CURRENT_SOURCE_DIR}/../third-party)
+set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
 
 # Note: LLVM_CMAKE_DIR does not include generated files
 set(LLVM_CMAKE_DIR ${LLVM_MAIN_SRC_DIR}/cmake/modules)


        


More information about the flang-commits mailing list