From 644a3289e768145455f3946f8caabeec29d1ff96 Mon Sep 17 00:00:00 2001 From: Stefan Granitz Date: Wed, 9 Jan 2019 16:25:31 +0000 Subject: [PATCH] [CMake] Fix standalone builds: workaround the cxx target not getting imported yet (unlike clang target) Summary: Handle standalone builds separately and print a warning if we have no libcxx. Reviewers: aprantl, JDevlieghere Reviewed By: JDevlieghere Subscribers: mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D56399 llvm-svn: 350737 --- lldb/CMakeLists.txt | 14 +++++++++++++- lldb/www/build.html | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt index a7536d6e292f7..13032d4f58568 100644 --- a/lldb/CMakeLists.txt +++ b/lldb/CMakeLists.txt @@ -101,10 +101,22 @@ if(LLDB_INCLUDE_TESTS) list(APPEND LLDB_TEST_DEPS liblldb) endif() + # Add dependencies if we test with the in-tree clang. + # This works with standalone builds as they import the clang target. if(TARGET clang) list(APPEND LLDB_TEST_DEPS clang) if(APPLE) - list(APPEND LLDB_TEST_DEPS cxx) + # If we build clang, we should build libcxx. + # FIXME: Standalone builds should import the cxx target as well. + if(LLDB_BUILT_STANDALONE) + # For now check that the include directory exists. + set(cxx_dir "${LLVM_DIR}/../../../include/c++") + if(NOT EXISTS ${cxx_dir}) + message(WARNING "LLDB test suite requires libc++ in llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}") + endif() + else() + list(APPEND LLDB_TEST_DEPS cxx) + endif() endif() endif() diff --git a/lldb/www/build.html b/lldb/www/build.html index 62a758f7b6a8a..381e17c4af13d 100755 --- a/lldb/www/build.html +++ b/lldb/www/build.html @@ -160,7 +160,7 @@

Building LLDB with Xcode

  • In Xcode 4.x: lldb/lldb.xcworkspace, select the lldb-tool scheme, and build.
  • Building LLDB with CMake

    -

    First download the LLVM, Clang, and LLDB sources. Refer to this page for precise instructions on this step.

    +

    First download the LLVM, Clang, libc++ and LLDB sources. Refer to this page for precise instructions on this step.

    Refer to the code signing instructions in lldb/docs/code-signing.txt for info on codesigning debugserver during the build.

    Using CMake is documented on the Building LLVM with CMake page. Ninja is the recommended generator to use when building LLDB with CMake.