-
Notifications
You must be signed in to change notification settings - Fork 1
/
meson.build
120 lines (109 loc) · 2.56 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
project(
'mediamtx-rpicamera',
'c', 'cpp',
version : '1.0.0',
meson_version : '>=1.0.0',
default_options: [
# 'c_std=c18',
'cpp_std=c++17',
'buildtype=release',
'strip=true',
'prefix=/',
'wrap_mode=forcefallback'
]
)
c_args = [
'-Ofast',
'-Werror',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-unused-result'
]
cpp_args = [
'-Ofast',
'-Werror',
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-Wno-unused-result'
]
add_project_arguments(c_args, language : 'c')
add_project_arguments(cpp_args, language : 'cpp')
x264_dep = dependency(
'x264',
fallback : ['x264', 'libx264_dep'],
default_options : [
'default_library=static',
'cli=false',
'strip=true',
'interlaced=false',
'bit-depth=8',
'chroma-format=all'
])
libcamera_dep = dependency(
'libcamera',
fallback : ['libcamera', 'libcamera_public'],
default_options : [
'buildtype=release',
'strip=true',
'wrap_mode=forcefallback',
'lc-compliance=disabled',
'ipas=rpi/vc4,rpi/pisp',
'pipelines=rpi/vc4,rpi/pisp',
'cam=disabled',
'documentation=disabled',
'gstreamer=disabled',
'pycamera=disabled',
'qcam=disabled',
'tracing=disabled',
'udev=disabled'
])
freetype_dep = dependency('freetype2', required : false)
if not freetype_dep.found()
cmake = import('cmake')
freetype_vars = cmake.subproject_options()
freetype_vars.set_override_option('wrap_mode', 'none')
freetype_vars.add_cmake_defines({
'CMAKE_BUILD_TYPE': 'Release',
'BUILD_SHARED_LIBS': false,
'FT_DISABLE_ZLIB': true,
'FT_DISABLE_BZIP2': true,
'FT_DISABLE_PNG': true,
'FT_DISABLE_HARFBUZZ': true,
'FT_DISABLE_BROTLI': true
})
freetype_proj = cmake.subproject('freetype', options : freetype_vars)
freetype_dep = freetype_proj.dependency('freetype')
endif
dependencies = [
x264_dep,
libcamera_dep,
freetype_dep
]
text_font = custom_target(
'text_font.h',
output : 'text_font.h',
command : ['./text_font.sh']
)
sources = [
'base64.c',
'camera.cpp',
'encoder_hard_h264.c',
'encoder_soft_h264.c',
'encoder.c',
'main.c',
'parameters.c',
'pipe.c',
'sensor_mode.c',
'text.c',
'window.c',
text_font
]
mtxrpicam = executable(
'mtxrpicam',
sources,
dependencies : dependencies,
install : true
)
meson.add_install_script('post_install.sh')