Fix build errors LLVM tests are disabled.

Original patch from alanbaker@google.com

Fixes the error:
CMake Error in <...>/llvm/cmake/modules/CMakeLists.txt:

export called with target "LLVMTestingSupport" which requires target
"gtest" that is not in the export set.

This occurs when LLVM is embedded in a larger project, but is configured not to
include tests. If testing is disabled gtest isn't available and LLVM fails to
configure.

Differential revision: https://reviews.llvm.org/D63097

llvm-svn: 365836
This commit is contained in:
Diego Novillo 2019-07-11 22:08:35 +00:00
parent f55aad0356
commit a35a7d49e5
1 changed files with 3 additions and 1 deletions

View File

@ -28,5 +28,7 @@ add_subdirectory(Passes)
add_subdirectory(TextAPI)
add_subdirectory(ToolDrivers)
add_subdirectory(XRay)
add_subdirectory(Testing)
if (LLVM_INCLUDE_TESTS)
add_subdirectory(Testing)
endif()
add_subdirectory(WindowsManifest)