-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmeson.build
79 lines (68 loc) · 1.97 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
# Project definition
project('rawrtcc', 'c',
version: '0.1.3',
default_options: ['c_std=c99'],
meson_version: '>=0.46.0')
# Set compiler warning flags
compiler = meson.get_compiler('c')
compiler_args = compiler.get_supported_arguments([
'-Wall',
'-Wmissing-declarations',
'-Wmissing-prototypes',
'-Wstrict-prototypes',
'-Wbad-function-cast',
'-Wsign-compare',
'-Wnested-externs',
'-Wshadow',
'-Waggregate-return',
'-Wcast-align',
'-Wextra',
'-Wold-style-definition',
'-Wdeclaration-after-statement',
'-Wuninitialized',
'-Wshorten-64-to-32',
'-pedantic',
])
add_project_arguments(compiler_args, language: 'c')
# Configuration
configuration = configuration_data()
# Dependency: re
# Note: We need to force using our own fork until re has accepted all our patches
re_dep = dependency('librawrre',
version: '>=0.6.0',
fallback: ['re', 're_dep'],
required: true)
# Dependencies list
dependencies = [
re_dep,
]
# Version
version = meson.project_version()
version_array = version.split('.')
configuration.set_quoted('RAWRTCC_VERSION', version)
configuration.set('RAWRTCC_VERSION_MAJOR', version_array[0])
configuration.set('RAWRTCC_VERSION_MINOR', version_array[1])
configuration.set('RAWRTCC_VERSION_PATCH', version_array[2])
# Set debug level
configuration.set('RAWRTC_DEBUG_LEVEL', get_option('debug_level'))
# Includes
include_dir = include_directories('include')
subdir('include')
# Sources
subdir('src')
# Build library
rawrtcc = library(meson.project_name(), sources,
dependencies: dependencies,
include_directories: include_dir,
install: true,
version: version)
# Declare dependency
rawrtcc_dep = declare_dependency(
include_directories: include_dir,
link_with: rawrtcc)
# Generate pkg-config file
pkg = import('pkgconfig')
pkg.generate(rawrtcc,
name: meson.project_name(),
description: 'Common code used in RAWRTC projects.',
url: 'https://github.com/rawrtc/rawrtc-common')