summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2021-01-13 00:27:40 +0900
committerSeungha Yang <seungha@centricular.com>2021-02-18 19:46:17 +0900
commit6da109cdb0f0578dfbb65845cfc071d04ba5cc61 (patch)
tree152cd8f3137949fb99a8badddf30a0a666c18598 /sys
parent5d4e45fe36f5d471a26ad3c6b7cf1fb2ae7a5a24 (diff)
downloadgstreamer-plugins-bad-6da109cdb0f0578dfbb65845cfc071d04ba5cc61.tar.gz
wasapi2: Always build if Windows 10 SDK is available
Add support for building wasapi2 plugin if Windows 10 SDK is available on system Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1951>
Diffstat (limited to 'sys')
-rw-r--r--sys/wasapi2/meson.build41
1 files changed, 37 insertions, 4 deletions
diff --git a/sys/wasapi2/meson.build b/sys/wasapi2/meson.build
index f5c774ce2..84d37c9ee 100644
--- a/sys/wasapi2/meson.build
+++ b/sys/wasapi2/meson.build
@@ -27,7 +27,7 @@ ksuser_dep = cc.find_library('ksuser', required : get_option('wasapi2'))
runtimeobject_dep = cc.find_library('runtimeobject', required : get_option('wasapi2'))
mmdeviceapi_dep = cc.find_library('mmdevapi', required : get_option('wasapi2'))
wasapi2_dep = [ole32_dep, ksuser_dep, runtimeobject_dep, mmdeviceapi_dep]
-have_symbols = false
+extra_args = []
foreach dep: wasapi2_dep
if not dep.found()
@@ -71,7 +71,7 @@ winapi_app = cxx.compiles('''#include <winapifamily.h>
return 0;
} ''',
dependencies: wasapi2_dep,
- name: 'checking if building winapi-partiion-app')
+ name: 'building for WINAPI_PARTITION_APP')
if not winapi_app
if wasapi2_option.enabled()
@@ -81,10 +81,43 @@ if not winapi_app
endif
endif
+win10_sdk = cxx.compiles('''#include <windows.h>
+ #ifndef WDK_NTDDI_VERSION
+ #error "unknown Windows SDK version"
+ #endif
+ #if (WDK_NTDDI_VERSION < 0x0A000000)
+ #error "Not a Windows 10 SDK"
+ #endif
+ ''',
+ name: 'building with Windows 10 SDK')
+
+if not win10_sdk
+ if wasapi2_option.enabled()
+ error('wasapi2 plugin was enabled explicitly, but Windows 10 SDK is unavailable')
+ else
+ subdir_done()
+ endif
+endif
+
+building_for_win10 = cxx.compiles('''#include <windows.h>
+ #ifndef WINVER
+ #error "unknown minimum supported OS version"
+ #endif
+ #if (WINVER < 0x0A00)
+ #error "Windows 10 API is not guaranteed"
+ #endif
+ ''',
+ name: 'building for Windows 10')
+
+if not building_for_win10
+ message('Bumping target Windows version to Windows 10 for building wasapi2 plugin')
+ extra_args += ['-DWINVER=0x0A00', '-D_WIN32_WINNT=0x0A00', '-DNTDDI_VERSION=WDK_NTDDI_VERSION']
+endif
+
gstwasapi2 = library('gstwasapi2',
wasapi2_sources,
- c_args : gst_plugins_bad_args + ['-DCOBJMACROS'],
- cpp_args : gst_plugins_bad_args,
+ c_args : gst_plugins_bad_args + ['-DCOBJMACROS'] + extra_args,
+ cpp_args : gst_plugins_bad_args + extra_args,
include_directories : [configinc],
dependencies : [gstaudio_dep] + wasapi2_dep,
install : true,