mgorny created this revision.
mgorny added reviewers: beanz, zturner.
mgorny added a subscriber: lldb-commits.

Include the gtest utility directory from LLVM sources when performing
a stand-alone build of LLDB. This is necessary to have a correct gtest
library to link tests against, as the one used by LLVM is not installed
(and not supposed to be). This is the same approach as used in clang.


https://reviews.llvm.org/D26245

Files:
  unittests/CMakeLists.txt


Index: unittests/CMakeLists.txt
===================================================================
--- unittests/CMakeLists.txt
+++ unittests/CMakeLists.txt
@@ -12,6 +12,14 @@
 
 include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
 
+if (LLDB_BUILT_STANDALONE)
+  # Build the gtest library needed for unittests, if we have LLVM sources
+  # handy.
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+    add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)
+  endif()
+endif()
+
 function(add_lldb_unittest test_name)
   add_unittest(LLDBUnitTests
     ${test_name}


Index: unittests/CMakeLists.txt
===================================================================
--- unittests/CMakeLists.txt
+++ unittests/CMakeLists.txt
@@ -12,6 +12,14 @@
 
 include(${LLDB_PROJECT_ROOT}/cmake/LLDBDependencies.cmake)
 
+if (LLDB_BUILT_STANDALONE)
+  # Build the gtest library needed for unittests, if we have LLVM sources
+  # handy.
+  if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+    add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)
+  endif()
+endif()
+
 function(add_lldb_unittest test_name)
   add_unittest(LLDBUnitTests
     ${test_name}
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to