|
|
77a21d |
From ccfad825687fc45d04ddb987c476dfafb26e56d9 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
|
|
|
77a21d |
Subject: 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
|
|
|
77a21d |
index 13d76e7fd935..7452bafb0756 100644
|
|
|
a1287a |
--- a/clang/CMakeLists.txt
|
|
|
a1287a |
+++ b/clang/CMakeLists.txt
|
|
|
77a21d |
@@ -159,12 +159,6 @@ if(CLANG_BUILT_STANDALONE)
|
|
|
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
|
|
|
77a21d |
@@ -586,7 +580,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 |
--
|
|
|
77a21d |
2.37.1
|
|
|
a1287a |
|