From 6dc6ec05d54aa07299629a13db6f0f65cb219a3f Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 12 Nov 2018 14:09:11 +0100 Subject: [PATCH] Configure version at meson project level Make meson aware of the project version, so that it does not print: Project version: undefined --- app/meson.build | 2 +- app/src/main.c | 2 +- meson.build | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/meson.build b/app/meson.build index 9833633e..3286fde1 100644 --- a/app/meson.build +++ b/app/meson.build @@ -86,7 +86,7 @@ conf = configuration_data() conf.set('BUILD_DEBUG', get_option('buildtype') == 'debug') # the version, updated on release -conf.set_quoted('SCRCPY_VERSION', '1.5') +conf.set_quoted('SCRCPY_VERSION', meson.project_version()) # the prefix used during configuration (meson --prefix=PREFIX) conf.set_quoted('PREFIX', get_option('prefix')) diff --git a/app/src/main.c b/app/src/main.c index 65887295..0603fef5 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -124,7 +124,7 @@ static void usage(const char *arg0) { } static void print_version(void) { - fprintf(stderr, "scrcpy v%s\n\n", SCRCPY_VERSION); + fprintf(stderr, "scrcpy %s\n\n", SCRCPY_VERSION); fprintf(stderr, "dependencies:\n"); fprintf(stderr, " - SDL %d.%d.%d\n", SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL); diff --git a/meson.build b/meson.build index 2f9ec462..fdac788e 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,7 @@ -project('scrcpy', 'c', meson_version: '>= 0.37', default_options : 'c_std=c11') +project('scrcpy', 'c', + version: '1.5', + meson_version: '>= 0.37', + default_options: 'c_std=c11') if get_option('build_app') subdir('app')