meson: wasapi2,mediafoundation: Work around Windows SDK header issue
authorSeungha Yang <seungha@centricular.com>
Sat, 16 Oct 2021 13:43:32 +0000 (22:43 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 17 Oct 2021 08:01:47 +0000 (08:01 +0000)
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>

subprojects/gst-plugins-bad/sys/mediafoundation/meson.build
subprojects/gst-plugins-bad/sys/wasapi2/meson.build

index 9c6c922..1ee0b8c 100644 (file)
@@ -155,6 +155,10 @@ configure_file(
   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',
   mf_sources,
   c_args : gst_plugins_bad_args + extra_c_args,
index acffe91..0fd22c4 100644 (file)
@@ -124,10 +124,14 @@ if not gstwinrt_dep.found()
   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',
   wasapi2_sources,
   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],
   dependencies : [gstaudio_dep, gstwinrt_dep] + wasapi2_dep,
   install : true,