Trying to build stable release 3.24.21 of GTK3 from the git sources using MSYS2 on Windows following these instructions. I've successfully built this version earlier from the tar.xz sources and MSYS2 configure/make
so I know I have all the required dependencies.
After cloning the gtk repo, I checkout the desired version. Then I run meson
as described in the instructions.
git checkout -b issue1234 3.24.21
meson setup --prefix /opt/gtk3 _build
For some reason, meson
fails to find either pkg-config
or cmake
, both of which exist in the PATH. It also believes it needs to build the latest version of glib2
although a sufficient version exists. When meson
tries to build glib2
, it bombs out with:
subprojects/glib/meson.build:1680:2: ERROR: Entry _WIN32_WINNT not in configuration data.
_WIN32_WINNT
was presumably set in the following glib/meson.build
block (it's the only place in the file where it's set):
# Windows SDK requirements and checks
if host_system == 'windows'
# 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
And the last line of this block in glib/meson.build
is where it bombs:
if has_syspoll and has_systypes
poll_includes = '''
#include<sys/poll.h>
#include<sys/types.h>'''
elif has_winsock2
poll_includes = '''
#define _WIN32_WINNT @0@
#include <winsock2.h>'''.format(glib_conf.get('_WIN32_WINNT'))
Any ideas about what's going on? Why aren't pkg-config/cmake
found? Why the need to build glib2
? And why the build failure?