meson: wasapi2,mediafoundation: Work around Windows SDK header issue

Some SDK headers are not standard compliant, so MSVC will
complain when such headers are in use with "/permissive-" compile
option. Use "/Zc:twoPhase-" to work around the issue as documented in
https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-160#windows-header-issues

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1174>
This commit is contained in:
Seungha Yang 2021-10-16 22:43:32 +09:00 committed by GStreamer Marge Bot
parent e94e60c342
commit 47a53f5063
2 changed files with 9 additions and 1 deletions

View file

@ -155,6 +155,10 @@ configure_file(
configuration: mf_config, configuration: mf_config,
) )
# Work around for Windows SDK header issue
# https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-160#windows-header-issues
extra_cpp_args += cxx.get_supported_arguments(['/Zc:twoPhase-'])
gstmediafoundation = library('gstmediafoundation', gstmediafoundation = library('gstmediafoundation',
mf_sources, mf_sources,
c_args : gst_plugins_bad_args + extra_c_args, c_args : gst_plugins_bad_args + extra_c_args,

View file

@ -124,10 +124,14 @@ if not gstwinrt_dep.found()
endif endif
endif endif
# Work around for Windows SDK header issue
# https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance?view=msvc-160#windows-header-issues
extra_cpp_args = cxx.get_supported_arguments(['/Zc:twoPhase-'])
gstwasapi2 = library('gstwasapi2', gstwasapi2 = library('gstwasapi2',
wasapi2_sources, wasapi2_sources,
c_args : gst_plugins_bad_args + ['-DCOBJMACROS'] + extra_args, c_args : gst_plugins_bad_args + ['-DCOBJMACROS'] + extra_args,
cpp_args : gst_plugins_bad_args + extra_args, cpp_args : gst_plugins_bad_args + extra_args + extra_cpp_args,
include_directories : [configinc], include_directories : [configinc],
dependencies : [gstaudio_dep, gstwinrt_dep] + wasapi2_dep, dependencies : [gstaudio_dep, gstwinrt_dep] + wasapi2_dep,
install : true, install : true,