meson: Improve MSVC and MinGW support and fix dependencies everywhere

Disable gio tests on Windows, fix .gitignore to not ignore
config.h.meson, and add more things to it.

Rename the library file naming and versioning to match what Autotools
outputs, e.g., libglib-2.0.so.0.5000.2 on Linux, libglib-2.0-0.dll  and
glib-2.0-0.dll on Windows with MSVC.

Several more tiny fixes, more executables built and installed, install
pkg-config and m4 files, fix building of gobject tests.

Changes to gdbus-codegen to support out-of-tree builds without
environment variables set (which you can't in Meson). We now add the
build directory to the Python module search path.
This commit is contained in:
Nirbheek Chauhan
2016-12-21 04:07:24 +05:30
committed by Matthias Clasen
parent 213957970e
commit fe2a9887a8
26 changed files with 981 additions and 706 deletions

View File

@@ -4,14 +4,18 @@
import sys, subprocess
assert(len(sys.argv) == 3)
if len(sys.argv) != 3:
print('Usage: {0} <listname> <outputfile>')
sys.exit(0)
_, listname, outname = sys.argv
glib_genmarshal = sys.argv[1]
listname = sys.argv[2]
outname = sys.argv[3]
if outname.endswith('.h'):
arg = '--header'
else:
arg = '--body'
output = subprocess.check_output(['glib-genmarshal', '--prefix=test', '--valist-marshallers', arg, listname])
output = subprocess.check_output([glib_genmarshal, '--prefix=test', '--valist-marshallers', arg, listname])
open(outname, 'wb').write(output)

View File

@@ -23,16 +23,14 @@ test_env = [
]
foreach test_name : gobject_tests
deps = [ libm, thread_dep ]
deps = [libm, thread_dep, libglib_dep, libgobject_dep]
test_src = '@0@.c'.format(test_name)
# private is an existing or reserved target it seems
if test_name == 'private'
test_name = 'gobject-private'
endif
exe = executable(test_name, test_src,
include_directories : inc_dirs,
c_args : [ '-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"' ],
link_with : [ libglib, libgobject ],
c_args : ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"'],
dependencies : deps,
)
test(test_name, exe, env : test_env)
@@ -40,29 +38,23 @@ endforeach
# The marshalers test requires running a binary, so we cannot build it when
# cross-compiling
if not meson.is_cross_build()
# FIXME: need to pass this as argument to the genmarshal script
# and somehow we need to specify it as build dep of the custom targets
# lib_genmarshal = meson.build_root() + '/gobject/glib-genmarshal'
if not meson.has_exe_wrapper()
genmarshal = find_program('gobject_test_marshal.py')
marshalers_h = custom_target('marshalers_h',
output : 'marshalers.h',
input : 'marshalers.list',
command : [ genmarshal, '@INPUT@', '@OUTPUT@' ],
command : [genmarshal, glib_genmarshal, '@INPUT@', '@OUTPUT@'],
)
marshalers_c = custom_target('marshalers_c',
output : 'marshalers.c',
input : 'marshalers.list',
command : [ genmarshal, '@INPUT@', '@OUTPUT@' ],
command : [genmarshal, glib_genmarshal, '@INPUT@', '@OUTPUT@'],
)
exe = executable('signals',
'signals.c', marshalers_h, marshalers_c,
include_directories : inc_dirs,
c_args : [ '-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"' ],
link_with : [ libglib, libgobject ],
c_args : ['-DHAVE_CONFIG_H=1', '-DG_LOG_DOMAIN="GLib-GObject"'],
dependencies : deps,
)
test('signals', exe, env : test_env)