[meson] Turn benchmark to a feature

This commit is contained in:
Ebrahim Byagowi 2020-06-29 00:39:43 +04:30
parent 7ee3194f98
commit 702847aadd
4 changed files with 7 additions and 4 deletions

View File

@ -226,7 +226,7 @@ jobs:
# test a meson based dist
- run: meson dist -Cbuild && rm -rf build
# test experimental APIs
- run: meson build -Dexperimental_api=true -Dbenchmark=true -Dexperimental_api=true -Doptimization=2 && ninja -j9 -Cbuild test # or meson test -Cbuild
- run: meson build -Dexperimental_api=true -Dexperimental_api=true -Doptimization=2 && ninja -j9 -Cbuild test # or meson test -Cbuild
# run benchmarks
- run: build/perf/perf && meson test -Cbuild --benchmark && rm -rf build # or ninja -Cbuild benchmark
# mingw

View File

@ -17,7 +17,7 @@ jobs:
- name: install meson and fonttools
run: sudo pip3 install meson fonttools
- name: run
run: meson build -Db_coverage=true -Dglib=enabled -Dcairo=enabled -Dicu=enabled -Dgraphite=enabled -Dfreetype=enabled -Dbenchmark=true -Doptimization=2
run: meson build -Db_coverage=true -Dglib=enabled -Dcairo=enabled -Dicu=enabled -Dgraphite=enabled -Dfreetype=enabled -Doptimization=2
- name: ci
run: meson test --print-errorlogs -Cbuild

View File

@ -344,7 +344,10 @@ if not get_option('tests').disabled()
subdir('test')
endif
if get_option('benchmark')
if not get_option('benchmark').disabled() and \
((host_machine.system() != 'windows' and \
not meson.is_subproject() and \
not meson.is_cross_build()) or get_option('benchmark').enabled())
subdir('perf')
endif

View File

@ -28,7 +28,7 @@ option('introspection', type: 'feature', value: 'auto', yield: true,
option('gtk_doc', type: 'feature', value: 'auto', yield: true,
description: 'Generate documentation with gtk-doc')
option('benchmark', type : 'boolean', value : false,
option('benchmark', type: 'feature', value: 'auto',
description: 'Enable benchmark tests')
option('icu_builtin', type: 'boolean', value: false,
description: 'Don\'t separate ICU support as harfbuzz-icu module')