Commit 4b82738f authored by Xavier Claessens's avatar Xavier Claessens

Meson: Add missing flags on Windows

win32_cflags gets used globally as cflags and exposed in the .pc file.
win32_ldflags gets passed to glib-2.0 and exposed in the .pc file.

This should match what the autotools build is currently doing with
GLIB_EXTRA_CFLAGS and G_LIBS_EXTRA.

https://bugzilla.gnome.org/show_bug.cgi?id=784995
parent cf28bf1f
Pipeline #11661 failed with stages
in 23 minutes and 14 seconds
......@@ -234,7 +234,7 @@ libglib = library('glib-2.0',
soversion : soversion,
install : true,
# intl.lib is not compatible with SAFESEH
link_args : [noseh_link_args, glib_link_flags],
link_args : [noseh_link_args, glib_link_flags, win32_ldflags],
include_directories : configinc,
link_with : [charset_lib, gnulib_lib],
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
......@@ -250,9 +250,9 @@ libglib_dep = declare_dependency(
include_directories : [configinc, glibinc])
pkg.generate(libraries : [libglib, libintl],
libraries_private : [osx_ldflags],
libraries_private : [osx_ldflags, win32_ldflags],
subdirs : ['glib-2.0'],
extra_cflags : ['-I${libdir}/glib-2.0/include'],
extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags,
variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
......
......@@ -1765,7 +1765,22 @@ if libmount_dep.length() != 0
glib_conf.set('HAVE_LIBMOUNT', 1)
endif
glib_conf.set('GIO_MODULE_DIR', glib_giomodulesdir)
# FIXME: Missing: @G_LIBS_EXTRA@ @GLIB_EXTRA_CFLAGS@ @G_MODULE_LDFLAGS@
# FIXME: Missing: @G_MODULE_LDFLAGS@
win32_cflags = []
win32_ldflags = []
if host_system == 'windows' and cc.get_id() != 'msvc'
# Ensure MSVC-compatible struct packing convention is used when
# compiling for Win32 with gcc. It is used for the whole project and exposed
# in glib-2.0.pc.
win32_cflags = ['-mms-bitfields']
add_project_arguments(win32_cflags, language : 'c')
# Win32 API libs, used only by libglib and exposed in glib-2.0.pc
win32_ldflags = ['-lws2_32', '-lole32', '-lwinmm', '-lshlwapi']
elif host_system == 'cygwin'
win32_ldflags = ['-luser32', '-lkernel32']
endif
# Tracing: dtrace
want_dtrace = get_option('dtrace')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment