File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -118,10 +118,12 @@ if(CLANG_BUILT_STANDALONE)
118
118
set (LLVM_UTILS_PROVIDED ON )
119
119
set (CLANG_TEST_DEPS FileCheck count not )
120
120
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 ()
125
127
endif ()
126
128
127
129
if (LLVM_LIT )
@@ -504,11 +506,13 @@ endif()
504
506
505
507
506
508
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 ()
512
516
add_subdirectory (test )
513
517
add_subdirectory (bindings/python/tests )
514
518
You can’t perform that action at this time.
0 commit comments