From c2127d08190bc9297bd1eb83968e1095d5392cb0 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 14 Feb 2018 11:10:09 +0100 Subject: [PATCH] Replace meson subprojects by subdir Since Meson 0.44, subproject_dir may not be '.' anymore. This implies we must move app/ and server/ to a subprojects/ directory, which requires to also change some gradle files. Instead, just use subdir(), with options to disable building of the app or the server. --- Makefile | 2 +- app/meson.build | 2 -- app/meson_options.txt | 1 - meson.build | 11 ++++++++--- meson_options.txt | 3 +++ 5 files changed, 12 insertions(+), 7 deletions(-) delete mode 100644 app/meson_options.txt create mode 100644 meson_options.txt diff --git a/Makefile b/Makefile index 81bef6d1..ffc6653c 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ build-portable: [ -d "$(PORTABLE_BUILD_DIR)" ] || ( mkdir "$(PORTABLE_BUILD_DIR)" && \ meson "$(PORTABLE_BUILD_DIR)" \ --buildtype release --strip -Db_lto=true \ - -Dapp:override_server_jar=scrcpy-server.jar ) + -Doverride_server_jar=scrcpy-server.jar ) ninja -C "$(PORTABLE_BUILD_DIR)" release-portable: clean dist-portable-zip sums diff --git a/app/meson.build b/app/meson.build index 6ff484a8..2797c7fb 100644 --- a/app/meson.build +++ b/app/meson.build @@ -1,5 +1,3 @@ -project('scrcpy-app', 'c') - src = [ 'src/main.c', 'src/command.c', diff --git a/app/meson_options.txt b/app/meson_options.txt deleted file mode 100644 index 1e2768e5..00000000 --- a/app/meson_options.txt +++ /dev/null @@ -1 +0,0 @@ -option('override_server_jar', type: 'string') diff --git a/meson.build b/meson.build index eb94df9c..4243cfe0 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,11 @@ -project('scrcpy', 'c', subproject_dir: '.') +project('scrcpy', 'c') -subproject('app') -subproject('server') +if get_option('build_app') + subdir('app') +endif + +if get_option('build_server') + subdir('server') +endif run_target('run', command: ['scripts/run-scrcpy.sh']) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 00000000..d02127c6 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,3 @@ +option('build_app', type: 'boolean', value: true) +option('build_server', type: 'boolean', value: true) +option('override_server_jar', type: 'string')