Index: cmake/Modules/AddCompilerRT.cmake =================================================================== --- cmake/Modules/AddCompilerRT.cmake +++ cmake/Modules/AddCompilerRT.cmake @@ -291,6 +291,12 @@ -I${COMPILER_RT_GTEST_PATH} ) +if(COMPILER_RT_STANDALONE_BUILD) + # Add a dummy target to satisfy dependencies on GTest when building + # stand-alone. GTest itself is provided via COMPILER_RT_GTEST_SOURCES. + add_custom_target(gtest) +endif() + append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_UNITTEST_CFLAGS) append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG -Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS)