Index: unittests/CMakeLists.txt =================================================================== --- unittests/CMakeLists.txt +++ unittests/CMakeLists.txt @@ -12,6 +12,14 @@ 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) + add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest) + endif() +endif() + function(add_lldb_unittest test_name) add_unittest(LLDBUnitTests ${test_name}