[Lldb-commits] [lldb] r288691 - [CMake] Don't add gtest if it is already there

Chris Bieneman via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 5 11:40:35 PST 2016

Author: cbieneman
Date: Mon Dec  5 13:40:34 2016
New Revision: 288691

URL: http://llvm.org/viewvc/llvm-project?rev=288691&view=rev
[CMake] Don't add gtest if it is already there

LLVM build trees export the gtest library through a special export set. If you're building against a build tree you shouldn't need to re-add gtest, but if you're building against an installed LLVM you do.


Modified: lldb/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=288691&r1=288690&r2=288691&view=diff
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Mon Dec  5 13:40:34 2016
@@ -15,7 +15,7 @@ include(${LLDB_PROJECT_ROOT}/cmake/LLDBD
   # Build the gtest library needed for unittests, if we have LLVM sources
   # handy.
-  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest AND NOT TARGET gtest)
     add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)

More information about the lldb-commits mailing list