Skip to content

Commit e99ccd8

Browse files
committed
Revert "Add install targets for gtest"
This reverts commit cb38df4. I accidentally committed this with the wrong commit message.
1 parent cb38df4 commit e99ccd8

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

clang/CMakeLists.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ if(CLANG_BUILT_STANDALONE)
118118
set(LLVM_UTILS_PROVIDED ON)
119119
set(CLANG_TEST_DEPS FileCheck count not)
120120
endif()
121-
endif()
122-
123-
if (NOT TARGET llvm_gtest)
124-
message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
121+
set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
122+
if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
123+
AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
124+
AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
125+
add_subdirectory(${UNITTEST_DIR} third-party/unittest)
126+
endif()
125127
endif()
126128

127129
if(LLVM_LIT)
@@ -504,11 +506,13 @@ endif()
504506

505507

506508
if( CLANG_INCLUDE_TESTS )
507-
add_subdirectory(unittests)
508-
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
509-
list(APPEND CLANG_TEST_PARAMS
510-
clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
511-
)
509+
if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
510+
add_subdirectory(unittests)
511+
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
512+
list(APPEND CLANG_TEST_PARAMS
513+
clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
514+
)
515+
endif()
512516
add_subdirectory(test)
513517
add_subdirectory(bindings/python/tests)
514518

0 commit comments

Comments
 (0)