]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - meson.build
sd-bus: Fix sd_bus_close.xml line wrapping
[thirdparty/systemd.git] / meson.build
index a8d6b5beeefee92049fe92f20517f00d7b688aad..fb9007756316b0e9154903b3ed44a1ac3707a207 100644 (file)
@@ -39,20 +39,22 @@ conf.set_quoted('RELATIVE_SOURCE_PATH', relative_source_path)
 
 want_ossfuzz = get_option('oss-fuzz')
 want_libfuzzer = get_option('llvm-fuzz')
-want_fuzzbuzz = get_option('fuzzbuzz')
-if want_ossfuzz + want_libfuzzer + want_fuzzbuzz > 1
-        error('only one of oss-fuzz, llvm-fuzz or fuzzbuzz can be specified')
+if want_ossfuzz + want_libfuzzer > 1
+        error('only one of oss-fuzz or llvm-fuzz can be specified')
 endif
 
 skip_deps = want_ossfuzz or want_libfuzzer
-fuzzer_build = want_ossfuzz or want_libfuzzer or want_fuzzbuzz
+fuzzer_build = want_ossfuzz or want_libfuzzer
 
 #####################################################################
 
 # Try to install the git pre-commit hook
-git_hook = run_command(join_paths(project_source_root, 'tools/add-git-hook.sh'))
-if git_hook.returncode() == 0
-        message(git_hook.stdout().strip())
+add_git_hook_sh = find_program('tools/add-git-hook.sh', required : false)
+if add_git_hook_sh.found()
+        git_hook = run_command(add_git_hook_sh)
+        if git_hook.returncode() == 0
+                message(git_hook.stdout().strip())
+        endif
 endif
 
 #####################################################################
@@ -322,8 +324,6 @@ if want_libfuzzer
         endif
 elif want_ossfuzz
         fuzzing_engine = meson.get_compiler('cpp').find_library('FuzzingEngine')
-elif want_fuzzbuzz
-        fuzzing_engine = meson.get_compiler('cpp').find_library(get_option('fuzzbuzz-engine'), dirs: get_option('fuzzbuzz-engine-dir'))
 endif
 
 # Those generate many false positives, and we do not want to change the code to
@@ -2506,7 +2506,7 @@ if conf.get('ENABLE_BINFMT') == 1
 endif
 
 if conf.get('ENABLE_REPART') == 1
-        executable('systemd-repart',
+        exe = executable('systemd-repart',
                    systemd_repart_sources,
                    include_directories : includes,
                    link_with : [libshared],
@@ -2518,6 +2518,12 @@ if conf.get('ENABLE_REPART') == 1
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootbindir)
+
+        if want_tests != 'false'
+                test('test-repart',
+                     test_repart_sh,
+                     args : exe.full_path())
+        endif
 endif
 
 if conf.get('ENABLE_VCONSOLE') == 1
@@ -2962,13 +2968,20 @@ if conf.get('ENABLE_NETWORKD') == 1
                    install_dir : rootbindir)
         public_programs += exe
 
-        executable('systemd-network-generator',
+        exe = executable('systemd-network-generator',
                    network_generator_sources,
                    include_directories : includes,
                    link_with : [networkd_link_with],
                    install_rpath : rootlibexecdir,
                    install : true,
                    install_dir : rootlibexecdir)
+
+        if want_tests != 'false'
+                test('test-network-generator-conversion',
+                     test_network_generator_conversion_sh,
+                     # https://github.com/mesonbuild/meson/issues/2681
+                     args : exe.full_path())
+        endif
 endif
 
 executable('systemd-sulogin-shell',
@@ -3099,7 +3112,7 @@ foreach tuple : fuzzers
         incs = tuple.length() >= 5 ? tuple[4] : includes
         link_args = []
 
-        if want_ossfuzz or want_fuzzbuzz
+        if want_ossfuzz
                 dependencies += fuzzing_engine
         elif want_libfuzzer
                 if fuzzing_engine.found()
@@ -3111,10 +3124,6 @@ foreach tuple : fuzzers
                 sources += 'src/fuzz/fuzz-main.c'
         endif
 
-        if want_fuzzbuzz
-                sources += 'src/fuzz/fuzzer-entry-point.c'
-        endif
-
         name = sources[0].split('/')[-1].split('.')[0]
 
         fuzzer_exes += executable(
@@ -3474,6 +3483,7 @@ foreach tuple : [
         ['debug siphash'],
         ['valgrind',         conf.get('VALGRIND') == 1],
         ['trace logging',    conf.get('LOG_TRACE') == 1],
+        ['install tests',    install_tests],
         ['link-udev-shared',      get_option('link-udev-shared')],
         ['link-systemctl-shared', get_option('link-systemctl-shared')],
         ['link-networkd-shared',  get_option('link-networkd-shared')],