71c2bfdd22
We encounter some problems with SDL2_image on MSYS2 (Windows), so implement our own XPM parsing which does not depend on SDL_image. The input XPM is considered safe (it's in our source repo), so do not check XPM format errors. This implies that read_xpm() is not safe to call on any unsafe input. Although less straightforward, use SDL_CreateRGBSurfaceFrom() instead of SDL_CreateRGBSurfaceWithFormatFrom() because it is available with SDL versions older than 2.0.5.
49 lines
1.1 KiB
Meson
49 lines
1.1 KiB
Meson
project('scrcpy-app', 'c')
|
|
|
|
src = [
|
|
'src/main.c',
|
|
'src/command.c',
|
|
'src/control.c',
|
|
'src/controlevent.c',
|
|
'src/convert.c',
|
|
'src/decoder.c',
|
|
'src/frames.c',
|
|
'src/lockutil.c',
|
|
'src/netutil.c',
|
|
'src/scrcpy.c',
|
|
'src/server.c',
|
|
'src/strutil.c',
|
|
'src/tinyxpm.c',
|
|
]
|
|
|
|
if host_machine.system() == 'windows'
|
|
src += [ 'src/sys/win/command.c' ]
|
|
else
|
|
src += [ 'src/sys/unix/command.c' ]
|
|
endif
|
|
|
|
dependencies = [
|
|
dependency('libavformat'),
|
|
dependency('libavcodec'),
|
|
dependency('libavutil'),
|
|
dependency('sdl2'),
|
|
dependency('SDL2_net'),
|
|
]
|
|
|
|
executable('scrcpy', src, dependencies: dependencies)
|
|
|
|
|
|
### TESTS
|
|
|
|
tests = [
|
|
['test_control_event_queue', ['tests/test_control_event_queue.c', 'src/controlevent.c']],
|
|
['test_control_event_serialize', ['tests/test_control_event_serialize.c', 'src/controlevent.c']],
|
|
['test_strutil', ['tests/test_strutil.c', 'src/strutil.c']],
|
|
]
|
|
|
|
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
|