[libcxx-commits] [PATCH] D137870: [CMake][compiler-rt] Don't load LLVM config in the runtimes build

Petr Hosek via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 11 14:52:55 PST 2022


phosek created this revision.
phosek added reviewers: smeenai, mstorsjo, mgorny.
Herald added subscribers: Enna1, dberris.
Herald added a project: All.
phosek requested review of this revision.
Herald added projects: Sanitizers, libc++, libc++abi.
Herald added subscribers: libcxx-commits, Sanitizers.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.

LLVM runtimes build already loads the LLVM config and sets all
appropriate variables, no need to do it again.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137870

Files:
  compiler-rt/CMakeLists.txt
  compiler-rt/lib/builtins/CMakeLists.txt
  runtimes/CMakeLists.txt


Index: runtimes/CMakeLists.txt
===================================================================
--- runtimes/CMakeLists.txt
+++ runtimes/CMakeLists.txt
@@ -54,6 +54,7 @@
 endif()
 if (NOT LLVM_FOUND)
   set(LLVM_TOOLS_BINARY_DIR ${LLVM_BINARY_DIR}/bin)
+  set(LLVM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
   set(LLVM_LIBRARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib)
 endif()
 
Index: compiler-rt/lib/builtins/CMakeLists.txt
===================================================================
--- compiler-rt/lib/builtins/CMakeLists.txt
+++ compiler-rt/lib/builtins/CMakeLists.txt
@@ -25,7 +25,9 @@
   include(base-config-ix)
   include(CompilerRTUtils)
 
-  load_llvm_config()
+  if (NOT LLVM_RUNTIMES_BUILD)
+    load_llvm_config()
+  endif()
   construct_compiler_rt_default_triple()
 
   include(SetPlatformToolchainTools)
Index: compiler-rt/CMakeLists.txt
===================================================================
--- compiler-rt/CMakeLists.txt
+++ compiler-rt/CMakeLists.txt
@@ -79,7 +79,9 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  load_llvm_config()
+  if (NOT LLVM_RUNTIMES_BUILD)
+    load_llvm_config()
+  endif()
   if (TARGET intrinsics_gen)
     # Loading the llvm config causes this target to be imported so place it
     # under the appropriate folder in an IDE.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137870.474867.patch
Type: text/x-patch
Size: 1333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221111/06ea2f3b/attachment.bin>


More information about the libcxx-commits mailing list