Commit 4b8bb5e0 authored by Jan Tojnar's avatar Jan Tojnar

meson: Warn when git is missing in non-dist builds

8b506034 fixes the issue of version headers
not being available when building out of VCS tarball (without .git directory)
but we were getting `unknown (unsupported)` version still. Turns out the version
silently fell back to `unknown` when git was not available.

Let's warn the user when this is the case.
parent 8b506034
Pipeline #132487 passed with stages
in 27 minutes and 39 seconds
......@@ -1456,15 +1456,19 @@ if is_git_repository or not has_version_h
replace_string: '@GIMP_GIT_LAST_COMMIT_YEAR@',
fallback: 'unknown (unsupported)',
)
if not is_git_repository
git = find_program('git', required: false)
if not is_git_repository or not git.found()
# We create git-version.h but know it will be useless because we are
# not in a git repository. Output a warning.
git_warning = '''
UNSUPPORTED BUILD!
This is not a distribution tarball (git-version.h missing) nor is it
a git repository. Therefore we have no reference for debugging.
This is not a distribution tarball (git-version.h missing) and
we could not establish the corresponding commit (either this is
not a git repository or git command is missing). Therefore
we have no reference for debugging.
Please either use release tarballs or build from the repository.
'''
warning(git_warning)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment