tstellar / rpms / llvm

Forked from rpms/llvm 2 years ago
Clone
bab8b9
From 9d496e978f59e153bb76e92229d5a524d92dee04 Mon Sep 17 00:00:00 2001
bab8b9
From: Tom Stellard <tstellar@redhat.com>
bab8b9
Date: Tue, 10 Sep 2019 13:33:48 -0700
bab8b9
Subject: [PATCH] CMake: Split test binary exports into their own export file
bab8b9
bab8b9
---
bab8b9
 llvm/cmake/modules/AddLLVM.cmake       | 7 ++++++-
bab8b9
 llvm/cmake/modules/CMakeLists.txt      | 3 +++
bab8b9
 llvm/cmake/modules/LLVMConfig.cmake.in | 1 +
bab8b9
 3 files changed, 10 insertions(+), 1 deletion(-)
bab8b9
bab8b9
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
bab8b9
index 200fc45..9eec7a7 100644
bab8b9
--- a/llvm/cmake/modules/AddLLVM.cmake
bab8b9
+++ b/llvm/cmake/modules/AddLLVM.cmake
bab8b9
@@ -953,7 +953,12 @@ macro(add_llvm_utility name)
bab8b9
       set(export_to_llvmexports)
bab8b9
       if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
bab8b9
           NOT LLVM_DISTRIBUTION_COMPONENTS)
bab8b9
-        set(export_to_llvmexports EXPORT LLVMExports)
bab8b9
+        if (${name} STREQUAL "not" OR ${name} STREQUAL "count" OR
bab8b9
+            ${name} STREQUAL "yaml-bench" OR ${name} STREQUAL "lli-child-target")
bab8b9
+          set(export_to_llvmexports EXPORT LLVMTestExports)
bab8b9
+        else()
bab8b9
+          set(export_to_llvmexports EXPORT LLVMExports)
bab8b9
+        endif()
bab8b9
         set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
bab8b9
       endif()
bab8b9
 
bab8b9
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
bab8b9
index dc982d2..c861f45 100644
bab8b9
--- a/llvm/cmake/modules/CMakeLists.txt
bab8b9
+++ b/llvm/cmake/modules/CMakeLists.txt
bab8b9
@@ -106,6 +106,7 @@ set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
bab8b9
 set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake")
bab8b9
 set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}")
bab8b9
 set(LLVM_CONFIG_STATIC_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake")
bab8b9
+set(LLVM_CONFIG_TEST_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMTestExports.cmake")
bab8b9
 configure_file(
bab8b9
   LLVMConfig.cmake.in
bab8b9
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
bab8b9
@@ -124,6 +125,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
bab8b9
             COMPONENT cmake-exports)
bab8b9
     install(EXPORT LLVMStaticExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
bab8b9
             COMPONENT cmake-exports)
bab8b9
+    install(EXPORT LLVMTestExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
bab8b9
+            COMPONENT cmake-exports)
bab8b9
   endif()
bab8b9
 
bab8b9
   install(FILES
bab8b9
diff --git a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in
bab8b9
index 6ef54a0..d81b09a 100644
bab8b9
--- a/llvm/cmake/modules/LLVMConfig.cmake.in
bab8b9
+++ b/llvm/cmake/modules/LLVMConfig.cmake.in
bab8b9
@@ -91,6 +91,7 @@ if(NOT TARGET LLVMSupport)
bab8b9
   @llvm_config_include_buildtree_only_exports@
bab8b9
 
bab8b9
   include("@LLVM_CONFIG_STATIC_EXPORTS_FILE@" OPTIONAL)
bab8b9
+  include("@LLVM_CONFIG_TEST_EXPORTS_FILE@" OPTIONAL)
bab8b9
 endif()
bab8b9
 
bab8b9
 # By creating intrinsics_gen here, subprojects that depend on LLVM's
bab8b9
-- 
bab8b9
1.8.3.1
bab8b9