diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -273,6 +273,14 @@ # define _LIBCPP_HAS_NO_INCOMPLETE_FORMAT # endif +// 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. Since users are allowed to define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +// it can't be set as a compiler flag in CMake. +# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && defined(_LIBCPP_BUILDING_LIBRARY) +# define _LIBCPP_REMOVE_TRANSITIVE_INCLUDES +# endif + // Need to detect which libc we're using if we're on Linux. # if defined(__linux__) # include