1project('gupnp-av', 'c', version : '0.14.0', default_options: ['c_std=c11'])
2
3gnome = import('gnome')
4
5glib_version = '2.58'
6gobject = dependency('gobject-2.0', version : '>= ' + glib_version)
7glib = dependency('glib-2.0', version : '>= ' + glib_version)
8libxml = dependency('libxml-2.0')
9
10cc = meson.get_compiler('c')
11
12# Compiler flags, taken from the Xorg macros
13if cc.get_id() == 'msvc'
14  # Compiler options taken from msvc_recommended_pragmas.h
15  # in GLib, based on _Win32_Programming_ by Rector and Newcomer
16  test_cflags = [
17    '-we4002', # too many actual parameters for macro
18    '-we4003', # not enough actual parameters for macro
19    '-w14010', # single-line comment contains line-continuation character
20    '-we4013', # 'function' undefined; assuming extern returning int
21    '-w14016', # no function return type; using int as default
22    '-we4020', # too many actual parameters
23    '-we4021', # too few actual parameters
24    '-we4027', # function declared without formal parameter list
25    '-we4029', # declared formal parameter list different from definition
26    '-we4033', # 'function' must return a value
27    '-we4035', # 'function' : no return value
28    '-we4045', # array bounds overflow
29    '-we4047', # different levels of indirection
30    '-we4049', # terminating line number emission
31    '-we4053', # an expression of type void was used as an operand
32    '-we4071', # no function prototype given
33    '-we4819', # the file contains a character that cannot be represented in the current code page
34  ]
35elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
36  test_cflags = [
37    '-Wpointer-arith',
38    '-Wmissing-declarations',
39    '-Wformat=2',
40    '-Wstrict-prototypes',
41    '-Wmissing-prototypes',
42    '-Wnested-externs',
43    '-Wbad-function-cast',
44    '-Wold-style-definition',
45    '-Wunused',
46    '-Wuninitialized',
47    '-Wshadow',
48    '-Wmissing-noreturn',
49    '-Wmissing-format-attribute',
50    '-Wredundant-decls',
51    '-Wlogical-op',
52    '-Werror=implicit',
53    '-Werror=nonnull',
54    '-Werror=init-self',
55    '-Werror=main',
56    '-Werror=missing-braces',
57    '-Werror=sequence-point',
58    '-Werror=return-type',
59    '-Werror=trigraphs',
60    '-Werror=array-bounds',
61    '-Werror=write-strings',
62    '-Werror=address',
63    '-Werror=int-to-pointer-cast',
64    '-Werror=pointer-to-int-cast',
65    '-fno-strict-aliasing',
66    '-Wno-int-conversion',
67  ]
68else
69  test_cflags = []
70endif
71
72common_cflags = cc.get_supported_arguments(test_cflags)
73
74add_project_arguments(cc.get_supported_arguments('-Werror=deprecated-declarations'), language: 'c')
75conf = configuration_data()
76conf.set_quoted('DATADIR', join_paths(get_option('prefix'), get_option('datadir'), 'gupnp-av'))
77conf.set_quoted('VERSION', meson.project_version())
78conf.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_' + glib_version.underscorify())
79conf.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_' + glib_version.underscorify())
80subdir('internal')
81
82subdir('libgupnp-av')
83subdir('tests')
84subdir('data')
85
86
87pkg = import('pkgconfig')
88pkg.generate(
89    gupnp_av_lib,
90    subdirs : 'gupnp-av-1.0',
91    description : 'GObject-based AV specific UPnP library'
92)
93
94if get_option('gtk_doc')
95    subdir('doc')
96endif
97
98if get_option('introspection') and get_option('vapi')
99    subdir('vala')
100endif
101