diff --git a/meson.build b/meson.build index d3bdfada85..28042f0ae6 100644 --- a/meson.build +++ b/meson.build @@ -50,9 +50,12 @@ fuzzer_build = want_ossfuzz or want_libfuzzer or want_fuzzbuzz ##################################################################### # 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 #####################################################################