From: Jérémie Astor Date: Sat, 27 Feb 2021 17:22:52 +0000 (+0100) Subject: :art: Add short commit hash as version X-Git-Tag: nightly~912 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=425ac89e8df98d12a5c4b5c84bd463b3f03901d4;p=gwion.git :art: Add short commit hash as version --- diff --git a/Makefile b/Makefile index d845210e..fa0ccc4b 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,9 @@ test_dir += examples CFLAGS += -Iutil/include -Iast/include -Ilibcmdapp/src -D_GNU_SOURCE +# add commit hash to version for now +CFLAGS += -DGWION_VERSION=\"$(shell git log -n1 --format="%h")\" + ifeq (${DEBUG_STACK}, 1) CFLAGS += -DDEBUG_STACK endif diff --git a/src/arg.c b/src/arg.c index bcae9ed7..c4504a27 100644 --- a/src/arg.c +++ b/src/arg.c @@ -288,12 +288,16 @@ static void myproc(void *data, cmdopt_t* option, const char* arg) { } } +#ifndef GWION_VERSION +#define GWION_VERSION "N.A." +#endif + ANN m_bool _arg_parse(struct ArgInternal *arg) { cmdapp_t app; const cmdapp_info_t info = { .program = "gwion", .synopses = NULL, // so it's automatic - .version = "N.A.", + .version = GWION_VERSION, .author = "Jérémie Astor", .year = 2016, .description = "Strongly timed musical programming language.",