Blame SOURCES/add-llvm-cmake-package.patch

6cad00
commit b18bde7a9bd6ed80f5721c47c805f0158b4fe9f8
6cad00
Author: Timm Bäder <tbaeder@redhat.com>
6cad00
Date:   Wed Mar 9 07:17:21 2022 +0100
6cad00
6cad00
    [compiler-rt] Add LLVM cmake package in standalone builds
6cad00
    
6cad00
    So the other files from the toplevel cmake/Modules directory have a
6cad00
    chance of being found.
6cad00
6cad00
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
6cad00
index 3a41aa43e406..6516e10fa3c5 100644
6cad00
--- a/compiler-rt/CMakeLists.txt
6cad00
+++ b/compiler-rt/CMakeLists.txt
6cad00
@@ -28,6 +28,12 @@ else()
6cad00
   set(CMAKE_CFG_RESOLVED_INTDIR "")
6cad00
 endif()
6cad00
 
6cad00
+if(COMPILER_RT_STANDALONE_BUILD)
6cad00
+  # Needed to find the other modules from the toplevel cmake/Modules dir
6cad00
+  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
6cad00
+  list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
6cad00
+endif()
6cad00
+
6cad00
 include(SetPlatformToolchainTools)
6cad00
 include(base-config-ix)
6cad00
 include(CompilerRTUtils)
6cad00
diff --git a/compiler-rt/test/CMakeLists.txt b/compiler-rt/test/CMakeLists.txt
6cad00
index 5c2b634e1180..098fb0481517 100644
6cad00
--- a/compiler-rt/test/CMakeLists.txt
6cad00
+++ b/compiler-rt/test/CMakeLists.txt
6cad00
@@ -1,6 +1,3 @@
6cad00
-# Needed for lit support in standalone builds.
6cad00
-include(AddLLVM)
6cad00
-
6cad00
 option(COMPILER_RT_TEST_STANDALONE_BUILD_LIBS
6cad00
   "When set to ON and testing in a standalone build, test the runtime \
6cad00
   libraries built by this standalone build rather than the runtime libraries \