Blame SOURCES/0001-PATCH-clang-Reorganize-gtest-integration.patch

300695
From c6b921c8d833546946b70a8c2640032fd7c62461 Mon Sep 17 00:00:00 2001
fd1acb
From: serge-sans-paille <sguelton@redhat.com>
300695
Date: Thu, 25 Feb 2021 14:04:52 +0100
300695
Subject: [PATCH 1/6] [PATCH][clang] Reorganize gtest integration
fd1acb
fd1acb
---
300695
 clang/CMakeLists.txt | 12 +++++-------
fd1acb
 1 file changed, 5 insertions(+), 7 deletions(-)
fd1acb
300695
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
300695
index 9e74014..0185276 100644
300695
--- a/clang/CMakeLists.txt
300695
+++ b/clang/CMakeLists.txt
300695
@@ -153,12 +153,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
fd1acb
         set(LLVM_UTILS_PROVIDED ON)
fd1acb
         set(CLANG_TEST_DEPS FileCheck count not)
fd1acb
       endif()
fd1acb
-      set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
fd1acb
-      if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
fd1acb
-          AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
fd1acb
-          AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
fd1acb
-        add_subdirectory(${UNITTEST_DIR} utils/unittest)
fd1acb
-      endif()
fd1acb
     else()
fd1acb
       # Seek installed Lit.
fd1acb
       find_program(LLVM_LIT
300695
@@ -537,7 +531,11 @@ endif()
fd1acb
 
fd1acb
 
fd1acb
 if( CLANG_INCLUDE_TESTS )
fd1acb
-  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
fd1acb
+  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
fd1acb
+  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
fd1acb
+      AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
fd1acb
+      AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
fd1acb
+    add_subdirectory(${UNITTEST_DIR} utils/unittest)
fd1acb
     add_subdirectory(unittests)
fd1acb
     list(APPEND CLANG_TEST_DEPS ClangUnitTests)
fd1acb
     list(APPEND CLANG_TEST_PARAMS
fd1acb
-- 
300695
1.8.3.1
fd1acb