meson.build 1.1 KB
Newer Older
R
Romain Vimont 已提交
1 2 3
project('scrcpy-app', 'c')

src = [
R
Romain Vimont 已提交
4
    'src/main.c',
R
Romain Vimont 已提交
5
    'src/command.c',
R
Romain Vimont 已提交
6 7 8
    'src/control.c',
    'src/controlevent.c',
    'src/convert.c',
R
Romain Vimont 已提交
9 10
    'src/decoder.c',
    'src/frames.c',
R
Romain Vimont 已提交
11
    'src/lockutil.c',
R
Romain Vimont 已提交
12
    'src/netutil.c',
R
Romain Vimont 已提交
13
    'src/scrcpy.c',
R
Romain Vimont 已提交
14
    'src/server.c',
R
Romain Vimont 已提交
15
    'src/strutil.c',
R
Romain Vimont 已提交
16
    'src/tinyxpm.c',
R
Romain Vimont 已提交
17 18 19
]

if host_machine.system() == 'windows'
R
Romain Vimont 已提交
20
    src += [ 'src/sys/win/command.c' ]
R
Romain Vimont 已提交
21
else
R
Romain Vimont 已提交
22
    src += [ 'src/sys/unix/command.c' ]
R
Romain Vimont 已提交
23 24 25 26 27 28 29 30 31 32 33
endif

dependencies = [
    dependency('libavformat'),
    dependency('libavcodec'),
    dependency('libavutil'),
    dependency('sdl2'),
    dependency('SDL2_net'),
]

executable('scrcpy', src, dependencies: dependencies)
R
Romain Vimont 已提交
34 35 36 37 38 39


### TESTS

tests = [
    ['test_control_event_queue', ['tests/test_control_event_queue.c', 'src/controlevent.c']],
40
    ['test_control_event_serialize', ['tests/test_control_event_serialize.c', 'src/controlevent.c']],
R
Romain Vimont 已提交
41
    ['test_strutil', ['tests/test_strutil.c', 'src/strutil.c']],
R
Romain Vimont 已提交
42 43 44 45 46 47 48 49
]

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