meson: check that cxx variable is set before using it

In some cases it is not defined. Eg in a yocto build:

src/systemd/meson.build:61:15: ERROR: Unknown variable cxx.
This commit is contained in:
Luca Boccassi 2020-12-03 16:17:43 +00:00 committed by Zbigniew Jędrzejewski-Szmek
parent 62e3a988f2
commit 442bc2afee
1 changed files with 1 additions and 1 deletions

View File

@ -54,7 +54,7 @@ if cc.has_argument('-std=iso9899:2017')
opts += [['c', '-std=iso9899:2017']]
endif
if add_languages('cpp', required : false)
if cxx_cmd != ''
opts += [['c++'],
['c++', '-std=c++98'],
['c++', '-std=c++11']]