diff options
| author | Michal Gorny <mgorny@gentoo.org> | 2016-11-02 22:57:23 +0000 |
|---|---|---|
| committer | Michal Gorny <mgorny@gentoo.org> | 2016-11-02 22:57:23 +0000 |
| commit | 1f368434f0dd2af95f38b375c58c9b9fa7d9235f (patch) | |
| tree | 484a2029127f9c1308bcbe2c697febe6589dc6ae | |
| parent | acf80064716710a6546282066f4ddd1eeb911f04 (diff) | |
| download | bcm5719-llvm-1f368434f0dd2af95f38b375c58c9b9fa7d9235f.tar.gz bcm5719-llvm-1f368434f0dd2af95f38b375c58c9b9fa7d9235f.zip | |
[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
llvm-svn: 285865
| -rw-r--r-- | lldb/unittests/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/unittests/CMakeLists.txt b/lldb/unittests/CMakeLists.txt index 74250ecdd45..cd5988d878c 100644 --- a/lldb/unittests/CMakeLists.txt +++ b/lldb/unittests/CMakeLists.txt @@ -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} |

