Skip to content

Commit

Permalink
Configure version at meson project level
Browse files Browse the repository at this point in the history
Make meson aware of the project version, so that it does not print:

    Project version: undefined
  • Loading branch information
rom1v committed Nov 12, 2018
1 parent b5e630e commit 6dc6ec0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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')
Expand Down

0 comments on commit 6dc6ec0

Please sign in to comment.