summaryrefslogtreecommitdiff
path: root/libcxx/CMakeLists.txt
diff options
context:
space:
mode:
authorMark de Wever <koraq@xs4all.nl>2023-03-10 17:31:58 +0100
committerMark de Wever <koraq@xs4all.nl>2023-03-15 18:01:03 +0100
commitc416234c384150e6aed49e5ecc37163cdd1c95c6 (patch)
tree9809b6ccf7e90e0fa74505d3718a5d47856dab4b /libcxx/CMakeLists.txt
parent94d9b7ce604ff416a1902cd041f10f4c4a6e72bb (diff)
downloadllvm-c416234c384150e6aed49e5ecc37163cdd1c95c6.tar.gz
[libc++] Disables transitive includes in library.
I noticed this wile investigating https://llvm.org/PR61314 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D145798
Diffstat (limited to 'libcxx/CMakeLists.txt')
-rw-r--r--libcxx/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index ed9aaf60f255..3309edd9fc4c 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -543,6 +543,11 @@ function(cxx_add_basic_build_flags target)
# library.
target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY)
+ # Make sure the library can be build without transitive includes. This makes
+ # it easier to upgrade the library to a newer language standard without build
+ # errors.
+ target_compile_definitions(${target} PRIVATE -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
+
if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
endif()