mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
Fix cross build with mingw32
At least on Ubuntu 20.04 the x86_64-w64-mingw32-gcc toolchain defaults to WinXP. We require at least Vista for FILE_STANDARD_INFO. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2022>
This commit is contained in:
parent
d522b17d9c
commit
f270f9e974
3 changed files with 34 additions and 1 deletions
|
@ -77,7 +77,6 @@ elif system == 'windows'
|
||||||
if compiler.get_id() == 'gcc'
|
if compiler.get_id() == 'gcc'
|
||||||
compile_args += [compiler.get_supported_arguments([
|
compile_args += [compiler.get_supported_arguments([
|
||||||
'-Wno-format',
|
'-Wno-format',
|
||||||
'-D_WIN32_WINNT=0x601', # Enables inet_ntop and friends
|
|
||||||
])]
|
])]
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
|
|
|
@ -408,6 +408,23 @@ endif
|
||||||
|
|
||||||
if host_machine.system() == 'windows'
|
if host_machine.system() == 'windows'
|
||||||
winsock2 = [cc.find_library('ws2_32')]
|
winsock2 = [cc.find_library('ws2_32')]
|
||||||
|
|
||||||
|
building_for_win7 = cc.compiles('''#include <windows.h>
|
||||||
|
#ifndef WINVER
|
||||||
|
#error "unknown minimum supported OS version"
|
||||||
|
#endif
|
||||||
|
#if (WINVER < _WIN32_WINNT_WIN7)
|
||||||
|
#error "Windows 7 API is not guaranteed"
|
||||||
|
#endif
|
||||||
|
''',
|
||||||
|
name: 'building for Windows 7')
|
||||||
|
|
||||||
|
if not building_for_win7
|
||||||
|
add_project_arguments([
|
||||||
|
'-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
|
||||||
|
'-DWINVER=_WIN32_WINNT_WIN7',
|
||||||
|
], language: ['c', 'cpp'])
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
winsock2 = []
|
winsock2 = []
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -404,6 +404,23 @@ if host_system == 'windows'
|
||||||
if cc.compiles(code, name : 'building for UWP')
|
if cc.compiles(code, name : 'building for UWP')
|
||||||
building_for_uwp = true
|
building_for_uwp = true
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
building_for_win7 = cc.compiles('''#include <windows.h>
|
||||||
|
#ifndef WINVER
|
||||||
|
#error "unknown minimum supported OS version"
|
||||||
|
#endif
|
||||||
|
#if (WINVER < _WIN32_WINNT_WIN7)
|
||||||
|
#error "Windows 7 API is not guaranteed"
|
||||||
|
#endif
|
||||||
|
''',
|
||||||
|
name: 'building for Windows 7')
|
||||||
|
|
||||||
|
if not building_for_win7
|
||||||
|
add_project_arguments([
|
||||||
|
'-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
|
||||||
|
'-DWINVER=_WIN32_WINNT_WIN7',
|
||||||
|
], language: ['c', 'cpp'])
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
backtrace_deps = []
|
backtrace_deps = []
|
||||||
|
|
Loading…
Reference in a new issue