[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.
This commit is contained in:
Valery Mironov
2025-12-02 13:29:27 +01:00
committed by GitHub
parent 7bced74576
commit 153c7e47d6

View File

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