mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-21 08:28:53 +02:00
windows: Move G_WINAPI_ONLY_APP to config.h
Also set the Windows version to be 10 or newer when targeting UWP, since the Windows 8 SDK does not have many of the APIs we need, such as _beginthreadex.
This commit is contained in:
@@ -39,12 +39,6 @@
|
|||||||
#include <sys/cygwin.h>
|
#include <sys/cygwin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Default family is DESKTOP_APP which is DESKTOP | APP
|
|
||||||
* We want to know when we're only building for apps */
|
|
||||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
|
||||||
#define G_WINAPI_ONLY_APP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_error (const gchar *format,
|
set_error (const gchar *format,
|
||||||
...)
|
...)
|
||||||
|
17
meson.build
17
meson.build
@@ -400,9 +400,22 @@ add_project_arguments(cc.get_supported_arguments(warning_c_args), language: 'c')
|
|||||||
# improve this.
|
# improve this.
|
||||||
glib_link_flags = cc.get_supported_link_arguments(warning_c_link_args)
|
glib_link_flags = cc.get_supported_link_arguments(warning_c_link_args)
|
||||||
|
|
||||||
# Windows Support (7+)
|
# Windows SDK requirements and checks
|
||||||
if host_system == 'windows'
|
if host_system == 'windows'
|
||||||
glib_conf.set('_WIN32_WINNT', '0x0601')
|
# Check whether we're building for UWP apps
|
||||||
|
code = '''
|
||||||
|
#include <windows.h>
|
||||||
|
#if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
|
||||||
|
#error "Not building for UWP"
|
||||||
|
#endif'''
|
||||||
|
if cc.compiles(code, name : 'building for UWP')
|
||||||
|
glib_conf.set('G_WINAPI_ONLY_APP', true)
|
||||||
|
# We require Windows 10+ on WinRT
|
||||||
|
glib_conf.set('_WIN32_WINNT', '0x0A00')
|
||||||
|
else
|
||||||
|
# We require Windows 7+ on Win32
|
||||||
|
glib_conf.set('_WIN32_WINNT', '0x0601')
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
functions = [
|
functions = [
|
||||||
|
Reference in New Issue
Block a user