[Lldb-commits] [lldb] r285865 - [cmake] Build gtest from LLVM when building standalone
Michal Gorny via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 2 15:57:24 PDT 2016
Author: mgorny
Date: Wed Nov 2 17:57:23 2016
New Revision: 285865
URL: http://llvm.org/viewvc/llvm-project?rev=285865&view=rev
Log:
[cmake] Build gtest from LLVM when building standalone
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.
Differential Revision: https://reviews.llvm.org/D26245
Modified:
lldb/trunk/unittests/CMakeLists.txt
Modified: lldb/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/CMakeLists.txt?rev=285865&r1=285864&r2=285865&view=diff
==============================================================================
--- lldb/trunk/unittests/CMakeLists.txt (original)
+++ lldb/trunk/unittests/CMakeLists.txt Wed Nov 2 17:57:23 2016
@@ -12,6 +12,14 @@ endif ()
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}
More information about the lldb-commits
mailing list