[meson] Make compatbile with 0.47.0

This commit is contained in:
Ebrahim Byagowi 2020-08-13 00:13:06 +04:30 committed by ebraminio
parent 58209c86a0
commit 6e32145dc9
8 changed files with 36 additions and 33 deletions

View File

@ -78,7 +78,7 @@ jobs:
steps:
- checkout
- run: apk update && apk add ragel gcc g++ glib-dev freetype-dev cairo-dev git py3-pip ninja
- run: pip3 install meson==0.49.0
- run: pip3 install meson==0.47.0
- run: meson build --buildtype=minsize
- run: ninja -Cbuild -j9
- run: meson test -Cbuild --print-errorlogs

View File

@ -52,8 +52,8 @@ endif
gnome.gtkdoc('harfbuzz',
main_sgml: 'harfbuzz-docs.xml',
src_dir: [meson.current_source_dir() / '..',
meson.current_build_dir() / '..',
src_dir: [join_paths(meson.current_source_dir(), '..'),
join_paths(meson.current_build_dir(), '..'),
],
scan_args: ['--deprecated-guards=HB_DISABLE_DEPRECATED',
'--ignore-decorators=HB_EXTERN',

View File

@ -1,5 +1,5 @@
project('harfbuzz', 'c', 'cpp',
meson_version: '>= 0.49.0',
meson_version: '>= 0.47.0',
version: '2.7.0',
default_options: [
'cpp_eh=none', # Just to support msvc, we are passing -fno-rtti also anyway
@ -348,12 +348,16 @@ if not get_option('tests').disabled()
subdir('test')
endif
if (not get_option('benchmark').disabled() and
get_option('wrap_mode') != 'nodownload' and
host_machine.system() != 'windows' and
not meson.is_subproject() and
not meson.is_cross_build())
subdir('perf')
# get_option('wrap_mode') isn't available in <0.49 and this
# is just an internal tool
if meson.version().version_compare('>=0.49')
if (not get_option('benchmark').disabled() and
get_option('wrap_mode') != 'nodownload' and
host_machine.system() != 'windows' and
not meson.is_subproject() and
not meson.is_cross_build())
subdir('perf')
endif
endif
if not get_option('docs').disabled()

View File

@ -24,4 +24,4 @@ benchmark('perf', executable('perf', 'perf.cc',
include_directories: [incconfig, incsrc],
link_with: [libharfbuzz],
install: false,
), workdir: meson.current_source_dir() / '..', timeout: 100)
), workdir: join_paths(meson.current_source_dir(), '..'), timeout: 100)

View File

@ -488,21 +488,20 @@ if get_option('tests').enabled()
endforeach
compiled_tests = {
'test-algs': ['test-algs.cc', 'hb-static.cc'],
'test-array': 'test-array.cc',
'test-iter': ['test-iter.cc', 'hb-static.cc'],
'test-meta': ['test-meta.cc', 'hb-static.cc'],
'test-number': ['test-number.cc', 'hb-number.cc'],
'test-ot-tag': 'hb-ot-tag.cc',
'test-unicode-ranges': 'test-unicode-ranges.cc',
'test-bimap': ['test-bimap.cc', 'hb-static.cc'],
}
if cpp.get_id() != 'msvc'
# TODO: MSVC doesn't like these, fix them
compiled_tests += {
'test-algs': ['test-algs.cc', 'hb-static.cc'],
'test-bimap': ['test-bimap.cc', 'hb-static.cc'],
'test-iter': ['test-iter.cc', 'hb-static.cc'],
'test-meta': ['test-meta.cc', 'hb-static.cc'],
}
endif
foreach name, source : compiled_tests
if cpp.get_id() == 'msvc' and ['test-algs', 'test-bimap', 'test-iter', 'test-meta'].contains(name)
# TODO: MSVC doesn't like these, fix them
continue
endif
test(name, executable(name, source,
include_directories: incconfig,
cpp_args: cpp_args + ['-DMAIN', '-UNDEBUG'],
@ -577,7 +576,7 @@ cmake_config.set('have_gobject', have_gobject_string)
configure_file(input: 'harfbuzz-config.cmake.in',
output: 'harfbuzz-config.cmake',
configuration: cmake_config,
install_dir: get_option('libdir') / 'cmake' / 'harfbuzz',
install_dir: join_paths(get_option('libdir'), 'cmake', 'harfbuzz'),
)
libharfbuzz_gobject_dep = null_dep
@ -615,7 +614,7 @@ if have_gobject
output: 'hb-gobject-enums.h',
command: [find_program('fix_get_types.py'), '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: get_option('prefix') / get_option('includedir') / meson.project_name(),
install_dir: join_paths(get_option('prefix'), get_option('includedir'), meson.project_name()),
)
hb_gobject_sources += [enum_c]

View File

@ -39,7 +39,7 @@ test('shape_fuzzer', find_program('run-shape-fuzzer-tests.py'),
],
timeout: 60,
depends: [hb_shape_fuzzer_exe, libharfbuzz, libharfbuzz_subset],
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
env: env,
suite: ['fuzzing', 'slow'],
)
@ -51,7 +51,7 @@ test('subset_fuzzer', find_program('run-subset-fuzzer-tests.py'),
# as the tests are ran concurrently let's raise acceptable time here
# ideally better to break and let meson handles them in parallel
timeout: 300,
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
env: env,
suite: ['fuzzing', 'slow'],
)
@ -60,7 +60,7 @@ test('draw_fuzzer', find_program('run-draw-fuzzer-tests.py'),
args: [
hb_draw_fuzzer_exe,
],
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
env: env,
suite: ['fuzzing'],
)

View File

@ -14,10 +14,10 @@ foreach file_name : in_house_tests
test(test_name, shaping_run_tests_py,
args: [
hb_shape,
meson.current_source_dir() / 'data' / 'in-house' / 'tests' / file_name,
join_paths(meson.current_source_dir(), 'data', 'in-house', 'tests', file_name),
],
env: env,
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
suite: ['shaping', 'in-house'],
)
endforeach
@ -28,10 +28,10 @@ foreach file_name : aots_tests
test(test_name, shaping_run_tests_py,
args: [
hb_shape,
meson.current_source_dir() / 'data' / 'aots' / 'tests' / file_name,
join_paths(meson.current_source_dir(), 'data', 'aots', 'tests', file_name),
],
env: env,
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
suite: ['shaping', 'aots'],
)
endforeach
@ -42,10 +42,10 @@ foreach file_name : text_rendering_tests
test(test_name, shaping_run_tests_py,
args: [
hb_shape,
meson.current_source_dir() / 'data' / 'text-rendering-tests' / 'tests' / file_name,
join_paths(meson.current_source_dir(), 'data', 'text-rendering-tests', 'tests', file_name),
],
env: env,
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
suite: ['shaping', 'text-rendering-tests'],
)
endforeach

View File

@ -32,12 +32,12 @@ foreach t : tests
test(t, run_test,
args: [
hb_subset,
meson.current_source_dir() / 'data' / 'tests' / fname,
join_paths(meson.current_source_dir(), 'data', 'tests', fname),
],
# as the tests are ran concurrently let's raise acceptable time here
# ideally better to break and let meson handles them in parallel
timeout: 500,
workdir: meson.current_build_dir() / '..' / '..',
workdir: join_paths(meson.current_build_dir(), '..', '..'),
suite: ['subset', 'slow'],
)
endforeach