mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
fuzz: don't panic without a C++ compiler
meson's `cpp_args` option is defined only if it detects a C++ compiler, otherwise we get an error: ../test/fuzz/meson.build:56:28: ERROR: Tried to access unknown option 'cpp_args'.
This commit is contained in:
parent
b0f965966b
commit
a3d3bf559c
@ -45,6 +45,13 @@ else
|
|||||||
sanitize_auto_features = 'auto'
|
sanitize_auto_features = 'auto'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
fuzz_c_args = get_option('c_args')
|
||||||
|
if cxx_cmd != ''
|
||||||
|
fuzz_cpp_args = get_option('cpp_args')
|
||||||
|
else
|
||||||
|
fuzz_cpp_args = []
|
||||||
|
endif
|
||||||
|
|
||||||
sanitize_address_undefined = custom_target(
|
sanitize_address_undefined = custom_target(
|
||||||
'sanitize-address-undefined-fuzzers',
|
'sanitize-address-undefined-fuzzers',
|
||||||
output : 'sanitize-address-undefined-fuzzers',
|
output : 'sanitize-address-undefined-fuzzers',
|
||||||
@ -52,8 +59,8 @@ sanitize_address_undefined = custom_target(
|
|||||||
project_source_root,
|
project_source_root,
|
||||||
'@OUTPUT@',
|
'@OUTPUT@',
|
||||||
'fuzzers',
|
'fuzzers',
|
||||||
' '.join(get_option('c_args') + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
|
' '.join(fuzz_c_args + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
|
||||||
' '.join(get_option('cpp_args') + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
|
' '.join(fuzz_cpp_args + '-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION'),
|
||||||
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ --auto-features=@2@'.format(
|
'-Dfuzz-tests=true -Db_lundef=false -Db_sanitize=address,undefined --optimization=@0@ @1@ --auto-features=@2@'.format(
|
||||||
get_option('optimization'),
|
get_option('optimization'),
|
||||||
get_option('werror') ? '--werror' : '',
|
get_option('werror') ? '--werror' : '',
|
||||||
|
@ -9,7 +9,7 @@ c_args="${4:?}"
|
|||||||
cpp_args="${5:?}"
|
cpp_args="${5:?}"
|
||||||
options="${6:?}"
|
options="${6:?}"
|
||||||
CC="${7:?}"
|
CC="${7:?}"
|
||||||
CXX="${8:?}"
|
CXX="$8"
|
||||||
|
|
||||||
if [ ! -f "$builddir/build.ninja" ]; then
|
if [ ! -f "$builddir/build.ninja" ]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
|
Loading…
Reference in New Issue
Block a user