[CMake] Don't add gtest if it is already there

LLVM build trees export the gtest library through a special export set. If you're building against a build tree you shouldn't need to re-add gtest, but if you're building against an installed LLVM you do.

llvm-svn: 288691
This commit is contained in:
Chris Bieneman 2016-12-05 19:40:34 +00:00
parent fc6100c195
commit 07522bb187
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
if (LLDB_BUILT_STANDALONE)
# Build the gtest library needed for unittests, if we have LLVM sources
# handy.
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest)
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest AND NOT TARGET gtest)
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)
endif()
endif()