Don't use tag for git version
parent
a631809cbb
commit
6beb263027
14
meson.build
14
meson.build
|
@ -13,7 +13,6 @@ buildtype = get_option('buildtype')
|
||||||
host_system = host_machine.system()
|
host_system = host_machine.system()
|
||||||
|
|
||||||
c_args = [
|
c_args = [
|
||||||
'-DPROJECT_VERSION="@0@"'.format(meson.project_version()),
|
|
||||||
'-D_GNU_SOURCE',
|
'-D_GNU_SOURCE',
|
||||||
'-fvisibility=hidden',
|
'-fvisibility=hidden',
|
||||||
'-DAML_UNSTABLE_API=1',
|
'-DAML_UNSTABLE_API=1',
|
||||||
|
@ -27,17 +26,20 @@ if buildtype != 'debug' and buildtype != 'debugoptimized'
|
||||||
c_args += '-DNDEBUG'
|
c_args += '-DNDEBUG'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
version = '"@0@"'.format(meson.project_version())
|
||||||
git = find_program('git', native: true, required: false)
|
git = find_program('git', native: true, required: false)
|
||||||
if git.found()
|
if git.found()
|
||||||
git_describe = run_command([git, 'describe', '--tags', '--long'], check: false)
|
git_commit = run_command([git, 'rev-parse', '--short', 'HEAD'])
|
||||||
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'], check: false)
|
git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD'])
|
||||||
if git_describe.returncode() == 0 and git_branch.returncode() == 0
|
if git_commit.returncode() == 0 and git_branch.returncode() == 0
|
||||||
c_args += '-DGIT_VERSION="@0@ (@1@)"'.format(
|
version = '"v@0@-@1@ (@2@)"'.format(
|
||||||
git_describe.stdout().strip(),
|
meson.project_version(),
|
||||||
|
git_commit.stdout().strip(),
|
||||||
git_branch.stdout().strip(),
|
git_branch.stdout().strip(),
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
add_project_arguments('-DPROJECT_VERSION=@0@'.format(version), language: 'c')
|
||||||
|
|
||||||
libdrm_inc = dependency('libdrm').partial_dependency(compile_args: true)
|
libdrm_inc = dependency('libdrm').partial_dependency(compile_args: true)
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,7 @@ static bool client_has_encoding(const struct nvnc_client* client,
|
||||||
enum rfb_encodings encoding);
|
enum rfb_encodings encoding);
|
||||||
static void process_fb_update_requests(struct nvnc_client* client);
|
static void process_fb_update_requests(struct nvnc_client* client);
|
||||||
|
|
||||||
#if defined(GIT_VERSION)
|
#if defined(PROJECT_VERSION)
|
||||||
EXPORT const char nvnc_version[] = GIT_VERSION;
|
|
||||||
#elif defined(PROJECT_VERSION)
|
|
||||||
EXPORT const char nvnc_version[] = PROJECT_VERSION;
|
EXPORT const char nvnc_version[] = PROJECT_VERSION;
|
||||||
#else
|
#else
|
||||||
EXPORT const char nvnc_version[] = "UNKNOWN";
|
EXPORT const char nvnc_version[] = "UNKNOWN";
|
||||||
|
|
Loading…
Reference in New Issue