Skip to content

Commit 46e63a2

Browse files
jameshilliardyuwata
authored andcommitted
meson: use cross compilation compatible c++ check
1 parent 8eab766 commit 46e63a2

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

meson.build

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,8 @@ want_tests = get_option('tests')
287287
slow_tests = want_tests != 'false' and get_option('slow-tests')
288288
install_tests = get_option('install-tests')
289289

290-
cxx = find_program('c++', required : fuzzer_build)
291-
if cxx.found()
290+
if add_languages('cpp', required : fuzzer_build)
292291
# Used only for tests
293-
add_languages('cpp')
294292
cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
295293
else
296294
cxx_cmd = ''

src/systemd/meson.build

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ if cc.has_argument('-std=iso9899:2017')
5252
opts += [['c', '-std=iso9899:2017']]
5353
endif
5454

55-
cxx = find_program('c++', required : false)
56-
if cxx.found()
55+
if add_languages('cpp', required : false)
5756
opts += [['c++'],
5857
['c++', '-std=c++98'],
5958
['c++', '-std=c++11']]

src/test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ tests += [
957957

958958
]
959959

960-
if cxx.found()
960+
if cxx_cmd != ''
961961
tests += [
962962
[['src/libsystemd/sd-bus/test-bus-vtable-cc.cc'],
963963
[],

0 commit comments

Comments
 (0)