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

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