[CMake] check-clang: Include ClangUnitTests if it can be built. Check existence of gtest.h then.

llvm-svn: 197688
This commit is contained in:
NAKAMURA Takumi 2013-12-19 16:05:44 +00:00
parent 5de6b43898
commit ed79c96f89
2 changed files with 7 additions and 8 deletions

View File

@ -390,8 +390,14 @@ option(CLANG_INCLUDE_TESTS
${LLVM_INCLUDE_TESTS})
if( CLANG_INCLUDE_TESTS )
if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
add_subdirectory(unittests)
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
list(APPEND CLANG_TEST_PARAMS
clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
)
endif()
add_subdirectory(test)
add_subdirectory(unittests)
endif()
option(CLANG_INCLUDE_DOCS "Generate build targets for the Clang docs."

View File

@ -38,13 +38,6 @@ set(CLANG_TEST_PARAMS
clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
if(CLANG_INCLUDE_TESTS)
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
list(APPEND CLANG_TEST_PARAMS
clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
)
endif()
if( NOT CLANG_BUILT_STANDALONE )
list(APPEND CLANG_TEST_DEPS
llvm-config