diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake @@ -73,6 +73,15 @@ endif() endif() +if(APPLE) + # Force-disable libc++ link steps to avoid the libc++abi dependency, + # if not enabled explicitly in builds from the monorepo. + if("libcxx" IN_LIST LLVM_ENABLE_PROJECTS AND NOT "libcxxabi" IN_LIST LLVM_ENABLE_PROJECTS) + set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "" FORCE) + set(LIBCXX_ENABLE_STATIC OFF CACHE BOOL "" FORCE) + endif() +endif() + if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows") set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL "Causes lldb to export all symbols when building liblldb.")