mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 23:58:54 +02:00
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
This commit is contained in:
@@ -234,7 +234,7 @@ libglib = library('glib-2.0',
|
|||||||
soversion : soversion,
|
soversion : soversion,
|
||||||
install : true,
|
install : true,
|
||||||
# intl.lib is not compatible with SAFESEH
|
# 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,
|
include_directories : configinc,
|
||||||
link_with : [charset_lib, gnulib_lib],
|
link_with : [charset_lib, gnulib_lib],
|
||||||
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
|
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
|
||||||
@@ -250,9 +250,9 @@ libglib_dep = declare_dependency(
|
|||||||
include_directories : [configinc, glibinc])
|
include_directories : [configinc, glibinc])
|
||||||
|
|
||||||
pkg.generate(libraries : [libglib, libintl],
|
pkg.generate(libraries : [libglib, libintl],
|
||||||
libraries_private : [osx_ldflags],
|
libraries_private : [osx_ldflags, win32_ldflags],
|
||||||
subdirs : ['glib-2.0'],
|
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')),
|
variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')),
|
||||||
'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
|
'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'),
|
||||||
'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
|
'gobject_query=' + join_paths('${bindir}', 'gobject-query'),
|
||||||
|
17
meson.build
17
meson.build
@@ -1765,7 +1765,22 @@ if libmount_dep.length() != 0
|
|||||||
glib_conf.set('HAVE_LIBMOUNT', 1)
|
glib_conf.set('HAVE_LIBMOUNT', 1)
|
||||||
endif
|
endif
|
||||||
glib_conf.set('GIO_MODULE_DIR', glib_giomodulesdir)
|
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
|
# Tracing: dtrace
|
||||||
want_dtrace = get_option('dtrace')
|
want_dtrace = get_option('dtrace')
|
||||||
|
Reference in New Issue
Block a user