[PATCH] D116472: Allow overriding path to shared CMake utilities

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 1 01:46:09 PST 2022


mstorsjo updated this revision to Diff 396850.
mstorsjo added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Removed the changes to runtimes; the ways they are built is a separate story - afaik we mandate the monorepo layout there (and the symlinking setup isn't used there afaik).

Added a default setting in llvm/CMakeLists.txt, renamed to match LLVM_THIRD_PARTY_DIR. Made it a plain internal variable - it's not supposed to user settable in general (I think we're moving to mandate the monorepo layout overall).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116472

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


Index: llvm/CMakeLists.txt
===================================================================
--- llvm/CMakeLists.txt
+++ llvm/CMakeLists.txt
@@ -308,6 +308,7 @@
 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)
Index: lld/CMakeLists.txt
===================================================================
--- lld/CMakeLists.txt
+++ lld/CMakeLists.txt
@@ -153,10 +153,14 @@
 "`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)
Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -227,10 +227,14 @@
   ${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)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116472.396850.patch
Type: text/x-patch
Size: 1585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220101/b72961e4/attachment-0001.bin>


More information about the llvm-commits mailing list