Refer to _LIBCPP_ENABLE_DEBUG_MODE instead of the old _LIBCPP_DEBUG
in a comment, and write that to __config_site correctly too.
See
13ea1343231fa4 and the comments in https://crbug.com/1358646.
Also change the default of libcxx_enable_debug_mode to false for now.
Since we used to not write _LIBCPP_ENABLE_DEBUG_MODE, the previous
default of true had no effect (except for compiling debug.cpp and
legacy_debug_handler.cpp, which we now no longer build by default).
So this (mostly) preserves previous behavior.
# libc++ inline ABI namespace. Defaults to __n, where n is the ABI version.
libcxx_abi_namespace = ""
+
+ # Whether to support libc++ opt-in debug mode via _LIBCPP_ENABLE_DEBUG_MODE.
+ libcxx_enable_debug_mode = false
+
}
"_LIBCPP_HAS_NO_WIDE_CHARACTERS=",
"_LIBCPP_ABI_DEFINES=",
"_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=",
- "_LIBCPP_ENABLE_DEBUG_MODE=",
]
if (libcxx_abi_version != 1) {
values += [ "_LIBCPP_ABI_VERSION=$libcxx_abi_version" ]
} else {
values += [ "_LIBCPP_ABI_NAMESPACE=__" + libcxx_abi_version ]
}
+ if (libcxx_enable_debug_mode) {
+ values += [ "_LIBCPP_ENABLE_DEBUG_MODE=1" ]
+ } else {
+ values += [ "_LIBCPP_ENABLE_DEBUG_MODE=" ]
+ }
}
write_cmake_config("write_modulemap") {
import("//llvm/utils/gn/build/symlink_or_copy.gni")
declare_args() {
- # Whether to support libc++ opt-in debug mode via _LIBCPP_DEBUG.
- libcxx_enable_debug_mode = true
-
# Build libc++ with definitions for operator new/delete.
libcxx_enable_new_delete_definitions = true