diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-05-16 12:08:25 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-05-19 17:23:47 +0100 |
commit | 5d3af9bf597cf42bd39bf2e4275c7f0746a947b5 (patch) | |
tree | 7878cef8e2c6cd67232001f3ef27c0091e2ca83d /tests | |
parent | 4819027c6e072c2e9e45228f8afd5d0767545026 (diff) | |
download | pango-5d3af9bf597cf42bd39bf2e4275c7f0746a947b5.tar.gz |
build: Add Meson build system
Meson is a meta build system that is:
- fast
- simpler to understand and use
- portable to multiple platforms through different backends
- well integrated with the GNOME platform
- well maintained
Using Meson allows us to build Pango much more quickly, and on all the
platforms we currently target, without any loss of functionality,
compared to Autotools.
Some timing comparisons with hot ccache for both build systems:
* autogen.sh: * meson
real 0m11.149s real 0m2.525s
user 0m8.153s user 0m1.609s
sys 0m2.363s sys 0m1.206s
* make -j$(($(nproc) + 2)) * ninja
real 0m9.186s real 0m3.387s
user 0m16.295s user 0m6.887s
sys 0m5.337s sys 0m1.318s
--------------------------------------------------------------
* autotools * meson + ninja
real 0m27.669s real 0m5.772s
user 0m45.622s user 0m8.465s
sys 0m10.698s sys 0m2.357s
System: Intel Core i7-7500U, SSD, 16GB of RAM
Diffstat (limited to 'tests')
-rw-r--r-- | tests/meson.build | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/meson.build b/tests/meson.build new file mode 100644 index 00000000..1a21101b --- /dev/null +++ b/tests/meson.build @@ -0,0 +1,57 @@ +test_cflags = [ + '-DSRCDIR=@0@'.format(meson.current_source_dir()), +] + +if xft_dep.found() + test_cflags += [ '-DHAVE_X', '-DHAVE_XFT' ] +endif + +if freetype_dep.found() + test_cflags += '-DHAVE_FREETYPE' +endif + +if host_system.contains('windows') + test_cflags += '-DHAVE_WIN32' +endif + +test_env = [ + 'srcdir=@0@'.format(meson.current_source_dir()), + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), +] + +tests = [ + [ 'testboundaries' ], + [ 'testboundaries_ucd' ], + [ 'testcolor' ], + [ 'testscript' ], +] + +if freetype_dep.found() + tests += [ + [ 'test-ot-tags', [ 'test-ot-tags.c' ], [ libpangoft2_dep ] ], + ] +endif + +if cairo_dep.found() + tests += [ + [ 'testiter', [ 'testiter.c' ], [ libpangocairo_dep ] ], + [ 'test-pangocairo-threads', [ 'test-pangocairo-threads.c' ], [ libpangocairo_dep, cairo_dep ] ], + [ 'markup-parse', [ 'markup-parse.c' ], [ libpangocairo_dep ] ], + [ 'test-layout', [ 'test-layout.c', 'test-common.c' ], [ libpangocairo_dep ] ], + [ 'test-font', [ 'test-font.c' ], [ libpangocairo_dep ] ], + [ 'testattributes', [ 'testattributes.c', 'test-common.c' ], [ libpangocairo_dep ] ], + ] +endif + +foreach t: tests + name = t[0] + src = t.get(1, [ '@0@.c'.format(name) ]) + deps = t.get(2, [ libpango_dep ]) + + bin = executable(name, src, + dependencies: deps, + include_directories: root_inc, + c_args: common_cflags + pango_debug_cflags) + test(name, bin, env: test_env) +endforeach |