From 153c7e47d6d160b1e158018b7d016aa3b227b9ed Mon Sep 17 00:00:00 2001 From: Valery Mironov Date: Tue, 2 Dec 2025 13:29:27 +0100 Subject: [PATCH] [libc++] Use private CMake flags to enable the pragma system_header macro when building (#138826) That property doesn't need to be propagated beyond the translation units of the libc++ built library itself. --- runtimes/cmake/Modules/WarningFlags.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/cmake/Modules/WarningFlags.cmake b/runtimes/cmake/Modules/WarningFlags.cmake index 43ef76561cc5..c253b9b117bc 100644 --- a/runtimes/cmake/Modules/WarningFlags.cmake +++ b/runtimes/cmake/Modules/WarningFlags.cmake @@ -2,7 +2,7 @@ include(HandleFlags) # Warning flags =============================================================== function(cxx_add_warning_flags target enable_werror enable_pedantic) - target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + target_compile_definitions(${target} PRIVATE -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) if (MSVC) # -W4 is the cl.exe/clang-cl equivalent of -Wall. (In cl.exe and clang-cl, # -Wall is equivalent to -Weverything in GCC style compiler drivers.)