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.
This commit is contained in:
Romain Vimont 2018-02-14 11:10:09 +01:00
parent ff94462d8a
commit c2127d0819
5 changed files with 12 additions and 7 deletions

View file

@ -34,7 +34,7 @@ build-portable:
[ -d "$(PORTABLE_BUILD_DIR)" ] || ( mkdir "$(PORTABLE_BUILD_DIR)" && \ [ -d "$(PORTABLE_BUILD_DIR)" ] || ( mkdir "$(PORTABLE_BUILD_DIR)" && \
meson "$(PORTABLE_BUILD_DIR)" \ meson "$(PORTABLE_BUILD_DIR)" \
--buildtype release --strip -Db_lto=true \ --buildtype release --strip -Db_lto=true \
-Dapp:override_server_jar=scrcpy-server.jar ) -Doverride_server_jar=scrcpy-server.jar )
ninja -C "$(PORTABLE_BUILD_DIR)" ninja -C "$(PORTABLE_BUILD_DIR)"
release-portable: clean dist-portable-zip sums release-portable: clean dist-portable-zip sums

View file

@ -1,5 +1,3 @@
project('scrcpy-app', 'c')
src = [ src = [
'src/main.c', 'src/main.c',
'src/command.c', 'src/command.c',

View file

@ -1 +0,0 @@
option('override_server_jar', type: 'string')

View file

@ -1,6 +1,11 @@
project('scrcpy', 'c', subproject_dir: '.') project('scrcpy', 'c')
subproject('app') if get_option('build_app')
subproject('server') subdir('app')
endif
if get_option('build_server')
subdir('server')
endif
run_target('run', command: ['scripts/run-scrcpy.sh']) run_target('run', command: ['scripts/run-scrcpy.sh'])

3
meson_options.txt Normal file
View file

@ -0,0 +1,3 @@
option('build_app', type: 'boolean', value: true)
option('build_server', type: 'boolean', value: true)
option('override_server_jar', type: 'string')