diff --git a/sys/wasapi2/meson.build b/sys/wasapi2/meson.build index f5c774ce29..84d37c9ee6 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 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 + #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 + #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,