From fbce456fad35efa857b9dea2cff3a938835de44d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 7 Oct 2020 10:33:40 -0400 Subject: [PATCH] [gn build] (manually) port ce1365f8f7e --- libcxx/src/CMakeLists.txt | 4 +++- llvm/utils/gn/secondary/libcxx/src/BUILD.gn | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt index 97e6e226b1ac..5de4a513ac17 100644 --- a/libcxx/src/CMakeLists.txt +++ b/libcxx/src/CMakeLists.txt @@ -56,7 +56,9 @@ set(LIBCXX_SOURCES ) if (LIBCXX_ENABLE_DEBUG_MODE) - list(APPEND LIBCXX_SOURCES debug.cpp) + list(APPEND LIBCXX_SOURCES + debug.cpp + ) endif() if(WIN32) diff --git a/llvm/utils/gn/secondary/libcxx/src/BUILD.gn b/llvm/utils/gn/secondary/libcxx/src/BUILD.gn index 6dccffa7aa34..71668b65f72f 100644 --- a/llvm/utils/gn/secondary/libcxx/src/BUILD.gn +++ b/llvm/utils/gn/secondary/libcxx/src/BUILD.gn @@ -2,6 +2,9 @@ import("//clang/runtimes.gni") 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 @@ -115,7 +118,6 @@ cxx_sources = [ "chrono.cpp", "condition_variable.cpp", "condition_variable_destructor.cpp", - "debug.cpp", "exception.cpp", "functional.cpp", "future.cpp", @@ -169,6 +171,9 @@ if (target_os == "win") { if (target_os == "solaris") { cxx_sources += [ "support/solaris/xlocale.cpp" ] } +if (libcxx_enable_debug_mode) { + cxx_sources += [ "debug.cpp" ] +} if (libcxx_enable_filesystem) { cxx_sources += [ "filesystem/directory_iterator.cpp",