-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmeson.build
103 lines (83 loc) · 3.67 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
project('gaeguli', 'c',
version: '1.99.0',
license: 'Apache-2.0',
meson_version: '>= 0.49.0',
default_options: [ 'warning_level=1',
'buildtype=debugoptimized',
'c_std=gnu89',
'stdsplit=false' ])
project_version = meson.project_version()
version_arr = project_version.split('.')
project_version_major = version_arr[0].to_int()
project_version_minor = version_arr[1].to_int()
project_version_micro = version_arr[2].to_int()
apiversion = '2.0'
soversion = 0
curversion = project_version_minor * 100 + project_version_micro
libversion = '@0@.@[email protected]'.format(soversion, curversion)
gaeguli_api_name = '@0@-@1@'.format(meson.project_name(), apiversion)
prefix = get_option('prefix')
cc = meson.get_compiler('c')
add_project_arguments('-Wdeclaration-after-statement', language: 'c')
cdata = configuration_data()
cdata.set_quoted('PACKAGE_STRING', meson.project_name())
cdata.set_quoted('PACKAGE_NAME', meson.project_name())
cdata.set_quoted('PACKAGE', meson.project_name())
cdata.set_quoted('VERSION', meson.project_version())
host_system = host_machine.system()
if host_system == 'linux'
cdata.set('DEFAULT_VIDEO_SOURCE', 'GAEGULI_VIDEO_SOURCE_V4L2SRC')
cdata.set('DEFAULT_VIDEO_RESOLUTION', 'GAEGULI_VIDEO_RESOLUTION_1920X1080')
cdata.set_quoted('DEFAULT_VIDEO_SOURCE_DEVICE', '/dev/video0')
elif ['darwin'].contains(host_system)
cdata.set('DEFAULT_VIDEO_SOURCE', 'GAEGULI_VIDEO_SOURCE_AVFVIDEOSRC')
cdata.set('DEFAULT_VIDEO_RESOLUTION', 'GAEGULI_VIDEO_RESOLUTION_640X480')
cdata.set_quoted('DEFAULT_VIDEO_SOURCE_DEVICE', '')
cdata.set('HAVE_OSX', 1)
else
cdata.set('DEFAULT_VIDEOSRC', 'GAEGULI_VIDEO_SOURCE_UNKNOWN')
cdata.set('DEFAULT_VIDEO_RESOLUTION', 'GAEGULI_VIDEO_RESOLUTION_UNKNOWN')
cdata.set_quoted('DEFAULT_VIDEO_SOURCE_DEVICE', '')
endif
cdata.set('DEFAULT_VIDEO_FRAMERATE', 15)
cdata.set('DEFAULT_VIDEO_BITRATE', 1000000)
cdata.set('DEFAULT_VIDEO_CODEC', 'GAEGULI_VIDEO_CODEC_H264_X264')
cdata.set('_GAEGULI_EXTERN', '__attribute__((visibility("default"))) extern')
configure_file(output : 'config.h', configuration : cdata)
# Dependencies
glib_req_version = '>= 2.44.0'
glib_dep = dependency('glib-2.0', version: glib_req_version,
fallback: ['glib', 'libglib_dep'])
gio_dep = [dependency('gio-2.0', version: glib_req_version,
fallback: ['glib', 'libgio_dep']),
dependency('gio-unix-2.0', version: glib_req_version,
fallback: ['glib', 'libgio_dep'])]
gobject_dep = dependency('gobject-2.0', version: glib_req_version,
fallback: ['glib', 'libgobject_dep'])
gst_req_version = '>= 1.16.0'
gst_dep = [
dependency('gstreamer-1.0', version: gst_req_version,
fallback: ['gstreamer', 'gst_dep']),
dependency ('gstreamer-base-1.0', version: gst_req_version,
fallback: ['gstreamer', 'gst_base_dep']),
dependency ('gstreamer-app-1.0', version: gst_req_version,
fallback: ['gst-plugins-base', 'gst_app_dep']),
dependency ('gstreamer-net-1.0', version: gst_req_version,
fallback: ['gstreamer', 'gst_net_dep']),
dependency ('gstreamer-mpegts-1.0', version: gst_req_version,
fallback: ['gst-plugins-bad', 'gstmpegts_dep']),
dependency ('gstreamer-codecparsers-1.0', version: gst_req_version,
fallback: ['gst-plugins-bad', 'gstcodecparsers_dep'])
]
libsrt_dep = dependency('srt', version: '>=1.4.1')
gnome = import('gnome')
gaeguli_incs = include_directories('.', 'gaeguli')
gaeguli_doc_incs = include_directories('gaeguli')
common_ldflags = [ ]
subdir('gaeguli')
subdir('tests')
subdir('tools')
subdir('doc')
python3 = import('python').find_installation()
run_command(python3, '-c',
'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')