diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt --- a/lldb/test/CMakeLists.txt +++ b/lldb/test/CMakeLists.txt @@ -135,9 +135,16 @@ "`LLDB_INCLUDE_TESTS=OFF`.") endif() endif() - add_lldb_test_dependency(cxx) endif() endif() + + # Add libc++ dependency for libc++-specific tests. This is an optional + # dependency as it's also possible to run the libc++ tests against the libc++ + # installed on the system. + if (TARGET cxx) + add_lldb_test_dependency(cxx) + endif() + endif() if (LLDB_BUILT_STANDALONE)