From a35a7d49e5e904bedd0bb7623ec04af499b5e9be Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Thu, 11 Jul 2019 22:08:35 +0000 Subject: [PATCH] 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 --- llvm/lib/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt index 17313df0ecf6..5a41d65b0cf3 100644 --- a/llvm/lib/CMakeLists.txt +++ b/llvm/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)