Remove git hash from version

This commit is contained in:
Your Name 2020-03-29 10:33:28 +02:00
commit c794d3519b
3 changed files with 6 additions and 13 deletions

View file

@ -160,7 +160,7 @@ parse_args(struct cg_server *server, int argc, char *argv[]) {
usage(stdout, argv[0]);
return false;
case 'v':
fprintf(stdout, "Cagebreak version 1.0.6\n");
fprintf(stdout, "Cagebreak version " CG_VERSION "\n");
exit(0);
default:
usage(stderr, argv[0]);

View file

@ -101,18 +101,10 @@ else
have_xwayland = false
endif
version = '@0@'.format(meson.project_version())
git = find_program('git', native: true, required: false)
if git.found()
git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'])
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'])
if git_commit.returncode() == 0 and git_branch.returncode() == 0
version = '@0@-@1@ (branch \'@2@\')'.format(
meson.project_version(),
git_commit.stdout().strip(),
git_branch.stdout().strip(),
)
endif
if get_option('version_override') != ''
version = '@0@'.format(get_option('version_override'))
else
version = '@0@'.format(meson.project_version())
endif
conf_data = configuration_data()

View file

@ -1,2 +1,3 @@
option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications')
option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets')
option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.')