meson: c++ is required for the fuzzer builds
The configuration would fail with an error about cpp being an unknown language anyway, but it's nicer to fail early and explicitly. https://github.com/systemd/systemd/pull/10339#issuecomment-428279175
This commit is contained in:
parent
9b0ca01903
commit
c09edc79ab
18
meson.build
18
meson.build
|
@ -27,6 +27,13 @@ substs = configuration_data()
|
||||||
substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
|
substs.set('PACKAGE_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
|
||||||
substs.set('PACKAGE_VERSION', meson.project_version())
|
substs.set('PACKAGE_VERSION', meson.project_version())
|
||||||
|
|
||||||
|
want_ossfuzz = get_option('oss-fuzz')
|
||||||
|
want_libfuzzer = get_option('llvm-fuzz')
|
||||||
|
if want_ossfuzz and want_libfuzzer
|
||||||
|
error('only one of oss-fuzz and llvm-fuzz can be specified')
|
||||||
|
endif
|
||||||
|
fuzzer_build = want_ossfuzz or want_libfuzzer
|
||||||
|
|
||||||
#####################################################################
|
#####################################################################
|
||||||
|
|
||||||
# Try to install the git pre-commit hook
|
# Try to install the git pre-commit hook
|
||||||
|
@ -274,7 +281,7 @@ want_tests = get_option('tests')
|
||||||
slow_tests = want_tests != 'false' and get_option('slow-tests')
|
slow_tests = want_tests != 'false' and get_option('slow-tests')
|
||||||
install_tests = get_option('install-tests')
|
install_tests = get_option('install-tests')
|
||||||
|
|
||||||
cxx = find_program('c++', required : false)
|
cxx = find_program('c++', required : fuzzer_build)
|
||||||
if cxx.found()
|
if cxx.found()
|
||||||
# Used only for tests
|
# Used only for tests
|
||||||
add_languages('cpp')
|
add_languages('cpp')
|
||||||
|
@ -283,16 +290,9 @@ else
|
||||||
cxx_cmd = ''
|
cxx_cmd = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
want_ossfuzz = get_option('oss-fuzz')
|
|
||||||
want_libfuzzer = get_option('llvm-fuzz')
|
|
||||||
fuzzer_build = want_ossfuzz or want_libfuzzer
|
|
||||||
if want_ossfuzz and want_libfuzzer
|
|
||||||
error('only one of oss-fuzz and llvm-fuzz can be specified')
|
|
||||||
endif
|
|
||||||
if want_libfuzzer
|
if want_libfuzzer
|
||||||
fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
|
fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
|
||||||
endif
|
elif want_ossfuzz
|
||||||
if want_ossfuzz
|
|
||||||
fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
|
fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue