[libc++] Add a CMake option to control whether the debug mode is supported
Some libc++ builds may want to disable support for the debug mode,
for example to reduce code size or because the current implementation
of the debug mode requires a global map. This commit adds the
LIBCXX_ENABLE_DEBUG_MODE CMake option and ties it into the test
suite.
It also adds a CI job to test this configuration going forward.
Differential Revision: https://reviews.llvm.org/D88923
diff --git a/libcxx/cmake/caches/Apple.cmake b/libcxx/cmake/caches/Apple.cmake
index 622a3af..cab7c14 100644
--- a/libcxx/cmake/caches/Apple.cmake
+++ b/libcxx/cmake/caches/Apple.cmake
@@ -11,6 +11,7 @@
set(LIBCXX_CXX_ABI libcxxabi CACHE STRING "")
set(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS OFF CACHE BOOL "")
set(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT ON CACHE BOOL "")
+set(LIBCXX_ENABLE_DEBUG_MODE OFF CACHE BOOL "")
set(LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS ON CACHE BOOL "")
set(LIBCXXABI_ENABLE_PIC OFF CACHE BOOL "")
diff --git a/libcxx/cmake/caches/Generic-nodebug.cmake b/libcxx/cmake/caches/Generic-nodebug.cmake
new file mode 100644
index 0000000..b301b2e
--- /dev/null
+++ b/libcxx/cmake/caches/Generic-nodebug.cmake
@@ -0,0 +1 @@
+set(LIBCXX_ENABLE_DEBUG_MODE OFF CACHE BOOL "")