diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -185,7 +185,15 @@ For example, -DLIBCXX_LIBRARY_VERSION=x.y will result in the library being named libc++.x.y.dylib, along with the usual symlinks pointing to that. On Apple platforms, this also controls the linker's 'current_version' property.") -set(LIBCXX_ABI_NAMESPACE "__${LIBCXX_ABI_VERSION}" CACHE STRING "The inline ABI namespace used by libc++. It defaults to __n where `n` is the current ABI version.") + +set(_default_abi_namespace "__${LIBCXX_ABI_VERSION}") +if (LIBCXX_ENABLE_DEBUG_MODE) + set(_default_abi_namespace "${_default_abi_namespace}d") +endif() +set(LIBCXX_ABI_NAMESPACE "${_default_abi_namespace}" CACHE STRING + "The inline ABI namespace used by libc++. It defaults to __n where `n` is the current ABI version. + If the debug mode is enabled, the 'd' suffix is added to the namespace to distinguish it from the + non-debug version of the library.") if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*") message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE must be a reserved identifier.") endif()