]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
Merge pull request #10334 from keszybz/nomempool
[thirdparty/systemd.git] / meson.build
index 6c1b36eb0618f590119d7128c5f9ff100856d2ac..6f1fa39e24e0b21df6a474299ffd641af2f485b4 100644 (file)
@@ -27,6 +27,13 @@ substs = configuration_data()
 substs.set('PACKAGE_URL',          'https://www.freedesktop.org/wiki/Software/systemd')
 substs.set('PACKAGE_VERSION',      meson.project_version())
 
+want_ossfuzz = get_option('oss-fuzz')
+want_libfuzzer = get_option('llvm-fuzz')
+if want_ossfuzz and want_libfuzzer
+        error('only one of oss-fuzz and llvm-fuzz can be specified')
+endif
+fuzzer_build = want_ossfuzz or want_libfuzzer
+
 #####################################################################
 
 # Try to install the git pre-commit hook
@@ -274,22 +281,18 @@ 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 : false)
+cxx = find_program('c++', required : fuzzer_build)
 if cxx.found()
         #  Used only for tests
         add_languages('cpp')
+        cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
+else
+        cxx_cmd = ''
 endif
 
-want_ossfuzz = get_option('oss-fuzz')
-want_libfuzzer = get_option('llvm-fuzz')
-fuzzer_build = want_ossfuzz or want_libfuzzer
-if want_ossfuzz and want_libfuzzer
-        error('only one of oss-fuzz and llvm-fuzz can be specified')
-endif
 if want_libfuzzer
         fuzzing_engine = meson.get_compiler('cpp').find_library('Fuzzer')
-endif
-if want_ossfuzz
+elif want_ossfuzz
         fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
 endif
 
@@ -392,7 +395,7 @@ if cc.compiles('''
         add_project_arguments('-Werror=shadow', language : 'c')
 endif
 
-cpp = ' '.join(cc.cmd_array()) + ' -E'
+cpp = ' '.join(cc.cmd_array() + get_option('c_args')) + ' -E'
 
 #####################################################################
 # compilation result tests
@@ -1836,7 +1839,7 @@ if conf.get('ENABLE_PORTABLED') == 1
                          dependencies : [threads],
                          install_rpath : rootlibexecdir,
                          install : true,
-                         install_dir : rootlibexecdir)
+                         install_dir : rootbindir)
         public_programs += exe
 endif