Blame SOURCES/0001-CMake-Split-static-library-exports-into-their-own-ex.patch

4fb979
From 8f6917ea11bd1bfbfe07f3577756d1c4abfdb916 Mon Sep 17 00:00:00 2001
4fb979
From: Tom Stellard <tstellar@redhat.com>
4fb979
Date: Fri, 6 Sep 2019 11:03:18 -0700
4fb979
Subject: [PATCH] CMake: Split static library exports into their own export
4fb979
 file
4fb979
4fb979
---
4fb979
 llvm/cmake/modules/AddLLVM.cmake       | 6 +++++-
4fb979
 llvm/cmake/modules/CMakeLists.txt      | 3 +++
4fb979
 llvm/cmake/modules/LLVMConfig.cmake.in | 2 ++
4fb979
 3 files changed, 10 insertions(+), 1 deletion(-)
4fb979
4fb979
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
4fb979
index 619e986..200fc45 100644
4fb979
--- a/llvm/cmake/modules/AddLLVM.cmake
4fb979
+++ b/llvm/cmake/modules/AddLLVM.cmake
4fb979
@@ -691,7 +691,11 @@ macro(add_llvm_library name)
4fb979
       if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
4fb979
           (in_llvm_libs AND "llvm-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS) OR
4fb979
           NOT LLVM_DISTRIBUTION_COMPONENTS)
4fb979
-        set(export_to_llvmexports EXPORT LLVMExports)
4fb979
+        if (ARG_SHARED)
4fb979
+          set(export_to_llvmexports EXPORT LLVMExports)
4fb979
+        else()
4fb979
+          set(export_to_llvmexports EXPORT LLVMStaticExports)
4fb979
+        endif()
4fb979
         set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
4fb979
       endif()
4fb979
 
4fb979
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
4fb979
index 9cf22b4..dc982d2 100644
4fb979
--- a/llvm/cmake/modules/CMakeLists.txt
4fb979
+++ b/llvm/cmake/modules/CMakeLists.txt
4fb979
@@ -105,6 +105,7 @@ set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
4fb979
 set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
4fb979
 set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake")
4fb979
 set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}")
4fb979
+set(LLVM_CONFIG_STATIC_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake")
4fb979
 configure_file(
4fb979
   LLVMConfig.cmake.in
4fb979
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
4fb979
@@ -121,6 +122,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
4fb979
   if(llvm_has_exports)
4fb979
     install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
4fb979
             COMPONENT cmake-exports)
4fb979
+    install(EXPORT LLVMStaticExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
4fb979
+            COMPONENT cmake-exports)
4fb979
   endif()
4fb979
 
4fb979
   install(FILES
4fb979
diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in
4fb979
index 536031f..6ef54a0 100644
4fb979
--- a/llvm/cmake/modules/LLVMConfig.cmake.in
4fb979
+++ b/llvm/cmake/modules/LLVMConfig.cmake.in
4fb979
@@ -89,6 +89,8 @@ if(NOT TARGET LLVMSupport)
4fb979
   set(LLVM_EXPORTED_TARGETS "@LLVM_CONFIG_EXPORTS@")
4fb979
   include("@LLVM_CONFIG_EXPORTS_FILE@")
4fb979
   @llvm_config_include_buildtree_only_exports@
4fb979
+
4fb979
+  include("@LLVM_CONFIG_STATIC_EXPORTS_FILE@" OPTIONAL)
4fb979
 endif()
4fb979
 
4fb979
 # By creating intrinsics_gen here, subprojects that depend on LLVM's
4fb979
-- 
4fb979
1.8.3.1
4fb979