jryans created this revision. jryans added reviewers: sgraenitz, JDevlieghere. Herald added a subscriber: mgorny. Herald added a reviewer: EricWF. Herald added a project: LLDB.
This adds a specific error message to clarify that lldb requires libcxx when built together with clang on macOS. In addition, the lldb building docs are also updated. Fixes https://bugs.llvm.org/show_bug.cgi?id=41866 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D61877 Files: lldb/CMakeLists.txt lldb/docs/resources/build.rst Index: lldb/docs/resources/build.rst =================================================================== --- lldb/docs/resources/build.rst +++ lldb/docs/resources/build.rst @@ -152,6 +152,12 @@ LLVM, then you can pass LLVM-specific CMake variables to cmake when building LLDB. +If you are building both Clang and LLDB together, be sure to also add libc++, +which is currently required for testing on macOS: + +:: + + > cmake -D LLVM_ENABLE_PROJECTS='clang;lldb;libcxx' $PATH_TO_LLVM -G Ninja Here are some commonly used LLDB-specific CMake variables: Index: lldb/CMakeLists.txt =================================================================== --- lldb/CMakeLists.txt +++ lldb/CMakeLists.txt @@ -124,6 +124,11 @@ message(WARNING "LLDB test suite requires libc++ in llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}") endif() else() + if(NOT libcxx IN_LIST LLVM_ENABLE_PROJECTS) + message(FATAL_ERROR + "LLDB test suite requires libc++, but it is currently disabled. " + "Please add `libcxx` to `LLVM_ENABLE_PROJECTS`.") + endif() list(APPEND LLDB_TEST_DEPS cxx) endif() endif()
Index: lldb/docs/resources/build.rst =================================================================== --- lldb/docs/resources/build.rst +++ lldb/docs/resources/build.rst @@ -152,6 +152,12 @@ LLVM, then you can pass LLVM-specific CMake variables to cmake when building LLDB. +If you are building both Clang and LLDB together, be sure to also add libc++, +which is currently required for testing on macOS: + +:: + + > cmake -D LLVM_ENABLE_PROJECTS='clang;lldb;libcxx' $PATH_TO_LLVM -G Ninja Here are some commonly used LLDB-specific CMake variables: Index: lldb/CMakeLists.txt =================================================================== --- lldb/CMakeLists.txt +++ lldb/CMakeLists.txt @@ -124,6 +124,11 @@ message(WARNING "LLDB test suite requires libc++ in llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}") endif() else() + if(NOT libcxx IN_LIST LLVM_ENABLE_PROJECTS) + message(FATAL_ERROR + "LLDB test suite requires libc++, but it is currently disabled. " + "Please add `libcxx` to `LLVM_ENABLE_PROJECTS`.") + endif() list(APPEND LLDB_TEST_DEPS cxx) endif() endif()
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits