From: Diego Novillo Date: Thu, 11 Jul 2019 22:08:35 +0000 (+0000) Subject: Fix build errors LLVM tests are disabled. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79eb12d19313cb52c6be1e72f8fdf481de1a1867;p=llvm 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365836 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 17313df0ecf..5a41d65b0cf 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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)