Skip to content

Commit

Permalink
Do not emit an error when building outside of git
Browse files Browse the repository at this point in the history
  • Loading branch information
meator committed May 19, 2024
1 parent 6bfe29d commit 2b50ce8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generated/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version_override = get_option('override-version')
if version_override == ''
version_header = vcs_tag(command: ['git', 'describe', '--dirty', '--broken'], input: 'version.hh.in', output: 'version.hh', fallback: meson.project_version())
# See the contents of meson_git_describe_wrapper.sh for explanation of its use
version_header = vcs_tag(command: 'meson_git_describe_wrapper.sh', input: 'version.hh.in', output: 'version.hh', fallback: meson.project_version())
else
conf_data = configuration_data()
conf_data.set('VCS_TAG', version_override)
Expand Down
10 changes: 10 additions & 0 deletions generated/meson_git_describe_wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
# The following command would normally print an error message if not run in a
# git repository (e.g. when run in an extracted release archive, which doesn't
# include git history).
# J4dd's build system is configured to handle git failures well. If git isn't
# available or if we're not in a git repository, version.txt is used to
# determine the version.
# Because this behavior is fully supported, printing an error message would only
# confuse the user, because the error message implies that something is wrong.
exec git describe --dirty --broken 2> /dev/null

0 comments on commit 2b50ce8

Please sign in to comment.