build: Add msvc_recommended_pragmas.h
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 19 Jun 2023 04:31:16 +0000 (12:31 +0800)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 17 Nov 2023 19:53:54 +0000 (14:53 -0500)
commit8d92e0fb6fcfe6045978ac8322f51529911d5479
treeb46e41bb9c5092e43a9aab40e8bbbe54f0e82b70
parent0bf68f1372cfd5b5076f752713e8cda886a7cbec
build: Add msvc_recommended_pragmas.h

We really always want to force-include msvc_recommended_pragmas.h to check for
things at compile time so that we can avoid stuff like missing includes or
attempting to return a value in a function that is supposed to have a
void-return-type.

The current problem is that, as indicated in the Visual Studio CI job, that we
couldn't locate msvc_recommended_pragmas.h during the build if GLib is built
as a subproject, and/or when msvc_recommended_pragmas.h is not in the paths
indicated by %INCLUDE%, meaning that the aforementioned issues would not be
caught by CI, which will then break builds on Visual Studio for people when
msvc_recommended_pragmas.h is found during their builds.

It would also be nice to be quiet from the warnings that we can really
disregard anyways.

So, add a copy of msvc_recommended_pragmas.h from GLib and update the build
files to look for it in build-aux/msvc, so that it can always be used during
the build, especially by the CI.
build-aux/msvc/msvc_recommended_pragmas.h [new file with mode: 0644]
meson.build