blob: 421df4b8ad17ac735d32743a03006c5330f251bc [file] [log] [blame]
James Kuszmaul28cc8252021-01-17 11:32:21 -08001# Project definition
2project('rawrtcc', 'c',
3 version: '0.1.3',
4 default_options: ['c_std=c99'],
5 meson_version: '>=0.46.0')
6
7# Set compiler warning flags
8compiler = meson.get_compiler('c')
9compiler_args = compiler.get_supported_arguments([
10 '-Wall',
11 '-Wmissing-declarations',
12 '-Wmissing-prototypes',
13 '-Wstrict-prototypes',
14 '-Wbad-function-cast',
15 '-Wsign-compare',
16 '-Wnested-externs',
17 '-Wshadow',
18 '-Waggregate-return',
19 '-Wcast-align',
20 '-Wextra',
21 '-Wold-style-definition',
22 '-Wdeclaration-after-statement',
23 '-Wuninitialized',
24 '-Wshorten-64-to-32',
25 '-pedantic',
26])
27add_project_arguments(compiler_args, language: 'c')
28
29# Configuration
30configuration = configuration_data()
31
32# Dependency: re
33# Note: We need to force using our own fork until re has accepted all our patches
34re_dep = dependency('librawrre',
35 version: '>=0.6.0',
36 fallback: ['re', 're_dep'],
37 required: true)
38
39# Dependencies list
40dependencies = [
41 re_dep,
42]
43
44# Version
45version = meson.project_version()
46version_array = version.split('.')
47configuration.set_quoted('RAWRTCC_VERSION', version)
48configuration.set('RAWRTCC_VERSION_MAJOR', version_array[0])
49configuration.set('RAWRTCC_VERSION_MINOR', version_array[1])
50configuration.set('RAWRTCC_VERSION_PATCH', version_array[2])
51
52# Set debug level
53configuration.set('RAWRTC_DEBUG_LEVEL', get_option('debug_level'))
54
55# Includes
56include_dir = include_directories('include')
57subdir('include')
58
59# Sources
60subdir('src')
61
62# Build library
63rawrtcc = library(meson.project_name(), sources,
64 dependencies: dependencies,
65 include_directories: include_dir,
66 install: true,
67 version: version)
68
69# Declare dependency
70rawrtcc_dep = declare_dependency(
71 include_directories: include_dir,
72 link_with: rawrtcc)
73
74# Generate pkg-config file
75pkg = import('pkgconfig')
76pkg.generate(rawrtcc,
77 name: meson.project_name(),
78 description: 'Common code used in RAWRTC projects.',
79 url: 'https://github.com/rawrtc/rawrtc-common')