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

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