diff --git a/meson_options.txt b/meson_options.txt index 1590e0f7e..5ef7709ad 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/test/fuzzing/meson.build b/test/fuzzing/meson.build index 1ce5c9a0b..1333801d2 100644 --- a/test/fuzzing/meson.build +++ b/test/fuzzing/meson.build @@ -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, )