Skip to content

Display and control your Android device

Replace meson subprojects by subdir

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