[libcxx-commits] [libcxx] c416234 - [libc++] Disables transitive includes in library.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 15 10:01:10 PDT 2023


Author: Mark de Wever
Date: 2023-03-15T18:01:03+01:00
New Revision: c416234c384150e6aed49e5ecc37163cdd1c95c6

URL: https://github.com/llvm/llvm-project/commit/c416234c384150e6aed49e5ecc37163cdd1c95c6
DIFF: https://github.com/llvm/llvm-project/commit/c416234c384150e6aed49e5ecc37163cdd1c95c6.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index ed9aaf60f255d..3309edd9fc4c8 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()


        


More information about the libcxx-commits mailing list