[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
This commit is contained in:
Mark de Wever 2023-03-10 17:31:58 +01:00
parent 94d9b7ce60
commit c416234c38

View File

@ -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()