This allows users to compile and run the project in a dev environment. meson setup x meson compile -C x meson devenv -C x scrcpy This is an alternative to `./run x`. PR #5658 <https://github.com/Genymobile/scrcpy/pull/5658> Signed-off-by: Romain Vimont <rom@rom1v.com>
32 lines
1.3 KiB
Meson
32 lines
1.3 KiB
Meson
# It may be useful to use a prebuilt server, so that no Android SDK is required
|
|
# to build. If the 'prebuilt_server' option is set, just copy the file as is.
|
|
prebuilt_server = get_option('prebuilt_server')
|
|
if prebuilt_server == ''
|
|
custom_target('scrcpy-server',
|
|
# gradle is responsible for tracking source changes
|
|
build_by_default: true,
|
|
build_always_stale: true,
|
|
output: 'scrcpy-server',
|
|
command: [find_program('./scripts/build-wrapper.sh'), meson.current_source_dir(), '@OUTPUT@', get_option('buildtype')],
|
|
console: true,
|
|
install: true,
|
|
install_dir: 'share/scrcpy')
|
|
else
|
|
if not prebuilt_server.startswith('/')
|
|
# prebuilt server path is relative to the root scrcpy directory
|
|
prebuilt_server = '../' + prebuilt_server
|
|
endif
|
|
custom_target('scrcpy-server-prebuilt',
|
|
input: prebuilt_server,
|
|
output: 'scrcpy-server',
|
|
command: ['cp', '@INPUT@', '@OUTPUT@'],
|
|
install: true,
|
|
install_dir: 'share/scrcpy')
|
|
endif
|
|
|
|
if meson.version().version_compare('>= 0.58.0')
|
|
devenv = environment()
|
|
devenv.set('SCRCPY_SERVER_PATH', meson.current_build_dir() / 'scrcpy-server')
|
|
meson.add_devenv(devenv)
|
|
endif
|