2017-12-12 22:12:07 +08:00
|
|
|
src = [
|
2018-01-23 23:32:29 +08:00
|
|
|
'src/main.c',
|
2017-12-12 22:12:07 +08:00
|
|
|
'src/command.c',
|
2017-12-14 18:38:44 +08:00
|
|
|
'src/controlevent.c',
|
2018-02-08 18:26:31 +08:00
|
|
|
'src/controller.c',
|
2017-12-14 18:38:44 +08:00
|
|
|
'src/convert.c',
|
2017-12-12 22:12:07 +08:00
|
|
|
'src/decoder.c',
|
2018-02-08 22:42:49 +08:00
|
|
|
'src/device.c',
|
2018-02-15 18:10:58 +08:00
|
|
|
'src/fpscounter.c',
|
2017-12-12 22:12:07 +08:00
|
|
|
'src/frames.c',
|
2018-02-15 19:07:47 +08:00
|
|
|
'src/inputmanager.c',
|
2017-12-16 00:31:23 +08:00
|
|
|
'src/lockutil.c',
|
2017-12-12 22:12:07 +08:00
|
|
|
'src/netutil.c',
|
2018-01-23 23:32:29 +08:00
|
|
|
'src/scrcpy.c',
|
2018-02-08 18:14:13 +08:00
|
|
|
'src/screen.c',
|
2018-01-22 18:22:31 +08:00
|
|
|
'src/server.c',
|
2017-12-12 22:12:07 +08:00
|
|
|
'src/strutil.c',
|
2018-02-06 00:29:40 +08:00
|
|
|
'src/tinyxpm.c',
|
2017-12-12 22:12:07 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
if host_machine.system() == 'windows'
|
2017-12-15 00:22:43 +08:00
|
|
|
src += [ 'src/sys/win/command.c' ]
|
2017-12-12 22:12:07 +08:00
|
|
|
else
|
2017-12-15 00:22:43 +08:00
|
|
|
src += [ 'src/sys/unix/command.c' ]
|
2017-12-12 22:12:07 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
dependency('libavformat'),
|
|
|
|
dependency('libavcodec'),
|
|
|
|
dependency('libavutil'),
|
|
|
|
dependency('sdl2'),
|
|
|
|
dependency('SDL2_net'),
|
|
|
|
]
|
|
|
|
|
2018-02-07 19:02:15 +08:00
|
|
|
conf = configuration_data()
|
|
|
|
|
2018-02-12 18:07:38 +08:00
|
|
|
# expose the build type
|
|
|
|
conf.set('BUILD_DEBUG', get_option('buildtype') == 'debug')
|
|
|
|
|
2018-02-07 19:37:53 +08:00
|
|
|
# the version, updated on release
|
2018-02-14 20:37:01 +08:00
|
|
|
conf.set_quoted('SCRCPY_VERSION', '0.1')
|
2018-02-07 19:37:53 +08:00
|
|
|
|
2018-02-13 18:55:12 +08:00
|
|
|
# the prefix used during configuration (meson --prefix=PREFIX)
|
2018-02-14 20:37:01 +08:00
|
|
|
conf.set_quoted('PREFIX', get_option('prefix'))
|
2018-02-13 18:55:12 +08:00
|
|
|
|
|
|
|
# the path of the server, which will be appended to the prefix
|
|
|
|
# ignored if OVERRIDE_SERVER_JAR if defined
|
|
|
|
# must be consistent with the install_dir in server/meson.build
|
2018-02-14 20:37:01 +08:00
|
|
|
conf.set_quoted('PREFIXED_SERVER_JAR', '/share/scrcpy/scrcpy-server.jar')
|
2018-02-13 18:55:12 +08:00
|
|
|
|
|
|
|
# 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_jar = get_option('override_server_jar')
|
|
|
|
if override_server_jar != ''
|
2018-02-14 20:37:01 +08:00
|
|
|
conf.set_quoted('OVERRIDE_SERVER_JAR', override_server_jar)
|
|
|
|
else
|
|
|
|
# undefine it
|
|
|
|
conf.set('OVERRIDE_SERVER_JAR', false)
|
2018-02-13 18:55:12 +08:00
|
|
|
endif
|
|
|
|
|
2018-02-07 19:02:15 +08:00
|
|
|
# the default client TCP port for the "adb reverse" tunnel
|
|
|
|
# overridden by option --port
|
|
|
|
conf.set('DEFAULT_LOCAL_PORT', '27183')
|
|
|
|
|
|
|
|
# the default max video size for both dimensions, in pixels
|
|
|
|
# overridden by option --max-size
|
|
|
|
conf.set('DEFAULT_MAX_SIZE', '0') # 0: unlimited
|
|
|
|
|
|
|
|
# the default video bitrate, in bits/second
|
|
|
|
# overridden by option --bit-rate
|
|
|
|
conf.set('DEFAULT_BIT_RATE', '4000000') # 4Mbps
|
|
|
|
|
2018-02-07 19:25:52 +08:00
|
|
|
# whether the app should always display the most recent available frame, even
|
|
|
|
# if the previous one has not been displayed
|
|
|
|
# SKIP_FRAMES improves latency at the cost of framerate
|
2018-02-15 18:23:14 +08:00
|
|
|
conf.set('SKIP_FRAMES', get_option('skip_frames'))
|
2018-02-07 19:25:52 +08:00
|
|
|
|
2018-02-14 20:37:01 +08:00
|
|
|
configure_file(configuration: conf, output: 'config.h')
|
2018-02-07 19:02:15 +08:00
|
|
|
|
2018-02-13 18:55:12 +08:00
|
|
|
executable('scrcpy', src, dependencies: dependencies, install: true)
|
2017-12-14 18:38:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
### TESTS
|
|
|
|
|
|
|
|
tests = [
|
|
|
|
['test_control_event_queue', ['tests/test_control_event_queue.c', 'src/controlevent.c']],
|
2018-01-19 23:55:39 +08:00
|
|
|
['test_control_event_serialize', ['tests/test_control_event_serialize.c', 'src/controlevent.c']],
|
2018-01-19 00:08:24 +08:00
|
|
|
['test_strutil', ['tests/test_strutil.c', 'src/strutil.c']],
|
2017-12-14 18:38:44 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
src_dir = include_directories('src')
|
|
|
|
|
|
|
|
foreach t : tests
|
|
|
|
exe = executable(t[0], t[1], include_directories: src_dir, dependencies: dependencies)
|
|
|
|
test(t[0], exe)
|
|
|
|
endforeach
|