Skip to content

Display and control your Android device

Configure version at meson project level

Romain Vimont6dc6ec05d54a
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')