Enabling Warnings for Precompiled Headers

Hi,

cmake_pch.hxx files generated by CMake when using precompiled headers have #pragma system_header for MSVC and #pragma GCC system_header for GCC at the very top prior to including the actual precompiled header. This ends up masking out all warnings coming from the precompiled header.

Is there a way configure cmake_pch.hxx to not have this pragma?

Thanks!

I found the following open issue:
https://gitlab.kitware.com/cmake/cmake/-/issues/21219

A workaround is to use set(CMAKE_PCH_PROLOGUE "").