meson: we cannot call get_compiler('cpp') if we didn't "add" it

Follow-up for f6d783ac3d.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-10-09 18:48:09 +02:00 committed by Lennart Poettering
parent 13711093ef
commit 1b2acaa7a6
2 changed files with 4 additions and 1 deletions

View File

@ -278,6 +278,9 @@ cxx = find_program('c++', required : false)
if cxx.found()
# Used only for tests
add_languages('cpp')
cpp_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
else
cpp_cmd = ''
endif
want_ossfuzz = get_option('oss-fuzz')

View File

@ -9,7 +9,7 @@ sanitize_address = custom_target(
'fuzzers',
'-Db_lundef=false -Db_sanitize=address',
' '.join(cc.cmd_array()),
' '.join(meson.get_compiler('cpp').cmd_array())])
cpp_cmd])
sanitizers = [['address', sanitize_address]]