[meson] Add fuzzer_ldflags

As ots, https://github.com/khaledhosny/ots/commit/4d37b9b
This commit is contained in:
Ebrahim Byagowi 2020-07-06 22:40:51 +04:30
parent e1c35ca581
commit d608f2ac85
2 changed files with 13 additions and 1 deletions

View File

@ -34,3 +34,5 @@ option('icu_builtin', type: 'boolean', value: false,
description: 'Don\'t separate ICU support as harfbuzz-icu module')
option('experimental_api', type: 'boolean', value: false,
description: 'Enable experimental APIs')
option('fuzzer_ldflags', type: 'string',
description: 'Extra LDFLAGS used during linking of fuzzing binaries')

View File

@ -8,9 +8,19 @@ tests = [
foreach file_name : tests
test_name = file_name.split('.')[0].underscorify()
exe = executable(test_name, [file_name, 'main.cc'],
sources = [file_name]
fuzzer_ldflags = []
if get_option('fuzzer_ldflags') == ''
sources += 'main.cc'
else
fuzzer_ldflags += get_option('fuzzer_ldflags')
endif
exe = executable(test_name, sources,
cpp_args: cpp_args,
include_directories: [incconfig, incsrc],
link_args: fuzzer_ldflags,
link_with: [libharfbuzz, libharfbuzz_subset],
install: false,
)