From 0c7a980bc10db15b5d6a36e368de707200758f3b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 25 Feb 2022 16:11:21 +0100 Subject: [PATCH] meson: Fix dist script --- meson.build | 5 +++-- meson_dist_script.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 3be249d3ed..a69529ef07 100644 --- a/meson.build +++ b/meson.build @@ -1476,7 +1476,8 @@ has_version_h = run_command('python3', '-c', 'import sys,os; sys.exit(0 if os.path.exists("git-version.h") else 1)' ).returncode() == 0 -if is_git_repository or not has_version_h +generate_version_h = is_git_repository or not has_version_h +if generate_version_h gitversion_h1 = vcs_tag( input : 'app/git-version.h.in', output: 'git-version.h.in.1', @@ -1647,7 +1648,7 @@ custom_target('Changelog', build_by_default: false, ) -meson.add_dist_script('meson_dist_script.sh') +meson.add_dist_script('meson_dist_script.sh', generate_version_h ? gitversion_h.full_path() : gitversion_h) ################################################################################ diff --git a/meson_dist_script.sh b/meson_dist_script.sh index e61da177a7..d900d7d1db 100755 --- a/meson_dist_script.sh +++ b/meson_dist_script.sh @@ -3,4 +3,4 @@ cp -f 'INSTALL' "${MESON_DIST_ROOT}" # rm -f "${MESON_DIST_ROOT}/INSTALL.in" -cp 'git-version.h' "${MESON_DIST_ROOT}" +cp "$1" "${MESON_DIST_ROOT}"