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

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