Simplify portable build configuration

To create a portable build (with scrcpy-server.jar accessible from the
scrcpy directory), replace OVERRIDE_SERVER_PATH by a simple compilation
flag: PORTABLE.

This paves the way to use more complex rules to determine the path of
scrcpy-server.jar in portable builds.
This commit is contained in:
Romain Vimont
2019-06-08 19:03:22 +02:00
parent b777760bca
commit eb34098add
4 changed files with 10 additions and 17 deletions

View File

@@ -93,16 +93,9 @@ conf.set_quoted('SCRCPY_VERSION', meson.project_version())
# the prefix used during configuration (meson --prefix=PREFIX)
conf.set_quoted('PREFIX', get_option('prefix'))
# the path of the server to be used "as is"
# this is useful for building a "portable" version (with the server in the same
# directory as the client)
override_server_path = get_option('override_server_path')
if override_server_path != ''
conf.set_quoted('OVERRIDE_SERVER_PATH', override_server_path)
else
# undefine it
conf.set('OVERRIDE_SERVER_PATH', false)
endif
# build a "portable" version (with scrcpy-server.jar accessible from the
# current directory)
conf.set('PORTABLE', get_option('portable'))
# the default client TCP port for the "adb reverse" tunnel
# overridden by option --port

View File

@@ -12,8 +12,8 @@
#define SOCKET_NAME "scrcpy"
#ifdef OVERRIDE_SERVER_PATH
# define DEFAULT_SERVER_PATH OVERRIDE_SERVER_PATH
#ifdef PORTABLE
# define DEFAULT_SERVER_PATH "scrcpy-server.jar"
#else
# define DEFAULT_SERVER_PATH PREFIX "/share/scrcpy/scrcpy-server.jar"
#endif