]> granicus.if.org Git - llvm/commitdiff
Fix build errors LLVM tests are disabled.
authorDiego Novillo <dnovillo@google.com>
Thu, 11 Jul 2019 22:08:35 +0000 (22:08 +0000)
committerDiego Novillo <dnovillo@google.com>
Thu, 11 Jul 2019 22:08:35 +0000 (22:08 +0000)
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

lib/CMakeLists.txt

index 17313df0ecf6d545bb341d8688f36f6e2602459a..5a41d65b0cf37761dcec0bccbee57b5be0e386cd 100644 (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)