1winrt_sources = [ 2 'gstwinrtdevicewatcher.cpp', 3] 4 5gstwinrt_dep = dependency('', required : false) 6 7extra_c_args = [ 8 '-DCOBJMACROS', 9] 10extra_comm_args = [ 11 '-DGST_USE_UNSTABLE_API', 12 '-DBUILDING_GST_WINRT', 13 '-DG_LOG_DOMAIN="GStreamer-WinRT"' 14] 15 16if host_system != 'windows' 17 subdir_done() 18endif 19 20# TODO: Need to bump mingw tool chain 21if cxx.get_id() != 'msvc' 22 subdir_done() 23endif 24 25runtimeobject_lib = cc.find_library('runtimeobject', required : false) 26if not runtimeobject_lib.found() 27 subdir_done() 28endif 29 30winapi_app = cxx.compiles('''#include <winapifamily.h> 31 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) 32 #error "not winrt" 33 #endif 34 int main (int argc, char ** argv) { 35 return 0; 36 } ''', 37 dependencies: runtimeobject_lib, 38 name: 'building for WinRT') 39 40if not winapi_app 41 subdir_done() 42endif 43 44win10_sdk = cxx.compiles('''#include <windows.h> 45 #ifndef WDK_NTDDI_VERSION 46 #error "unknown Windows SDK version" 47 #endif 48 #if (WDK_NTDDI_VERSION < 0x0A000000) 49 #error "Not a Windows 10 SDK" 50 #endif 51 ''', 52 name: 'building with Windows 10 SDK') 53 54if not win10_sdk 55 subdir_done() 56endif 57 58building_for_win10 = cxx.compiles('''#include <windows.h> 59 #ifndef WINVER 60 #error "unknown minimum supported OS version" 61 #endif 62 #if (WINVER < 0x0A00) 63 #error "Windows 10 API is not guaranteed" 64 #endif 65 ''', 66 name: 'building for Windows 10') 67 68if not building_for_win10 69 message('Bumping target Windows version to Windows 10 for building gstwinrt library') 70 extra_comm_args += ['-DWINVER=0x0A00', '-D_WIN32_WINNT=0x0A00', '-DNTDDI_VERSION=WDK_NTDDI_VERSION'] 71endif 72 73gstwinrt = library('gstwinrt-' + api_version, 74 winrt_sources, 75 c_args : gst_plugins_bad_args + extra_c_args + extra_comm_args, 76 cpp_args : gst_plugins_bad_args + extra_comm_args, 77 include_directories : [configinc, libsinc], 78 version : libversion, 79 soversion : soversion, 80 install : true, 81 dependencies : [gstbase_dep, runtimeobject_lib] 82) 83 84# Still non-public api, should not install headers 85gstwinrt_dep = declare_dependency(link_with : gstwinrt, 86 include_directories : [libsinc], 87 dependencies : [gstbase_dep, runtimeobject_lib]) 88