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