]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use cross compilation compatible c++ check
authorJames Hilliard <james.hilliard1@gmail.com>
Thu, 27 Dec 2018 01:16:20 +0000 (09:16 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Dec 2018 03:17:06 +0000 (12:17 +0900)
meson.build
src/systemd/meson.build
src/test/meson.build

index b338886c38971f7bfeb59b6031407e757d69160f..1964b1aa87b489a67de722d420af436aefb922b6 100644 (file)
@@ -287,10 +287,8 @@ want_tests = get_option('tests')
 slow_tests = want_tests != 'false' and get_option('slow-tests')
 install_tests = get_option('install-tests')
 
-cxx = find_program('c++', required : fuzzer_build)
-if cxx.found()
+if add_languages('cpp', required : fuzzer_build)
         #  Used only for tests
-        add_languages('cpp')
         cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
 else
         cxx_cmd = ''
index e0c967efc575e77b5d3f8771bff558d4e564ff31..75c48b07a510c56e65563a2e20e74e2b0b1056ac 100644 (file)
@@ -52,8 +52,7 @@ if cc.has_argument('-std=iso9899:2017')
         opts += [['c', '-std=iso9899:2017']]
 endif
 
-cxx = find_program('c++', required : false)
-if cxx.found()
+if add_languages('cpp', required : false)
         opts += [['c++'],
                  ['c++', '-std=c++98'],
                  ['c++', '-std=c++11']]
index ea049a6fbad33e353fe66e28e4130f5dca6b111e..d9d87e02c5659b330346fe2d5deb7b56f52980a9 100644 (file)
@@ -957,7 +957,7 @@ tests += [
 
 ]
 
-if cxx.found()
+if cxx_cmd != ''
         tests += [
                 [['src/libsystemd/sd-bus/test-bus-vtable-cc.cc'],
                  [],