-
Notifications
You must be signed in to change notification settings - Fork 229
/
meson.build
105 lines (84 loc) · 3 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
project('rpicam-apps', 'c', 'cpp',
meson_version : '>= 0.64.0',
version : '1.5.3',
default_options : [
'werror=true',
'warning_level=3',
'cpp_std=c++17',
'c_std=c11',
'buildtype=release',
],
license : 'BSD-2-Clause')
meson.add_dist_script('utils' / 'gen-dist.sh')
fs = import('fs')
cpp_arguments = ['-pedantic', '-Wno-unused-parameter', '-faligned-new']
# Needed for file sizes > 32-bits.
cpp_arguments += '-D_FILE_OFFSET_BITS=64'
cxx = meson.get_compiler('cpp')
cpu = host_machine.cpu()
neon = get_option('neon_flags')
if cxx.get_id() == 'gcc'
cpp_arguments += '-Wno-psabi'
endif
if cpu == 'aarch64' or neon == 'arm64'
cpp_arguments += '-ftree-vectorize'
elif neon == 'armv8-neon'
cpp_arguments += ['-mfpu=neon-fp-armv8', '-ftree-vectorize']
endif
dl_dep = dependency('dl', required : true)
libcamera_dep = dependency('libcamera', required : true)
summary({
'location' : libcamera_dep.get_variable('libdir'),
'version' : libcamera_dep.version()
},
section : 'libcamera')
rpicam_app_src = []
rpicam_app_dep = [libcamera_dep, dl_dep]
subdir('core')
subdir('encoder')
subdir('image')
subdir('output')
subdir('preview')
subdir('utils')
add_project_arguments(cpp_arguments, language : 'cpp')
# Must be put after add_project_arguments as it defines shared library targets.
subdir('post_processing_stages')
# Generate a version string.
version_cmd = [meson.project_source_root() / 'utils' / 'version.py', meson.project_version()]
# Check if a version.gen file is present.
# This would have been generated from the meson dist command.
dist_version_file = meson.project_source_root() / 'version.gen'
if fs.is_file(dist_version_file)
version_cmd += fs.read(dist_version_file)
endif
version_cpp = vcs_tag(command : version_cmd,
replace_string: '@VER@',
input : meson.project_source_root() / 'core' / 'version.cpp.in',
output : 'version.cpp',
fallback : meson.project_version())
rpicam_app_src += version_cpp
rpicam_app = library(
'rpicam_app',
rpicam_app_src,
soversion : meson.project_version(),
include_directories : include_directories('.'),
install : true,
name_prefix : '',
dependencies : rpicam_app_dep,
)
# Install a symlink to the old library name for legacy purposes.
install_symlink('libcamera_app.so',
install_dir: get_option('libdir'),
pointing_to: 'rpicam_app.so')
subdir('apps')
summary({
'libav encoder' : enable_libav,
'drm preview' : enable_drm,
'egl preview' : enable_egl,
'qt preview' : enable_qt,
'OpenCV postprocessing' : enable_opencv,
'TFLite postprocessing' : enable_tflite,
'Hailo postprocessing' : enable_hailo,
'IMX500 postprocessing' : get_option('enable_imx500'),
},
bool_yn : true, section : 'Build configuration')