File: meson.build

package info (click to toggle)
libcloudproviders 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 340 kB
  • sloc: ansic: 2,243; xml: 15; makefile: 10; javascript: 5
file content (86 lines) | stat: -rw-r--r-- 2,722 bytes parent folder | download
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
project ('libcloudproviders', 'c',
  version: '0.4.0',
  meson_version: '>=1.9.0',
  license: 'LGPL-3.0-or-later',
  default_options: [
    'c_std=gnu99',
    'warning_level=2',
  ]
)

libcloudproviders_minor_version = meson.project_version().split('.')[1].to_int()
libcloudproviders_micro_version = meson.project_version().split('.')[2].to_int()

libcloudproviders_api_version = '0.3'
libcloudproviders_soversion = '0'
libcloudproviders_library_version = '@0@.@1@.@2@'.format(libcloudproviders_soversion, libcloudproviders_minor_version, libcloudproviders_micro_version)

cc = meson.get_compiler('c')

test_cflags = [
  '-Wno-unused-parameter',
  '-Wno-missing-field-initializers',
  '-Wstrict-prototypes',
  '-Wmissing-prototypes',
  '-Werror=implicit-function-declaration',
  '-Werror=pointer-arith',
  '-Werror=init-self',
  ['-Werror=format-security','-Werror=format=1'],
  '-Werror=date-time',
]
global_cflags = []
foreach cflag : test_cflags
  if cc.has_multi_arguments(cflag)
    global_cflags += cflag
  endif
endforeach
add_project_arguments(global_cflags, language: 'c')

glib_req_version = '2.64'
glib_ver = '>= @0@'.format(glib_req_version)
glib = dependency ('glib-2.0', version: glib_ver)
gio = dependency ('gio-2.0', version: glib_ver)

host_os = host_machine.system().to_lower()
if host_os.contains('mingw') or host_os.contains('cygwin') or host_os.contains('windows')
    gio_platform = dependency ('gio-windows-2.0', version: glib_ver)
else
    gio_platform = dependency ('gio-unix-2.0', version: glib_ver)
endif

add_project_arguments(
  '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_@0@_@1@'.format(glib_req_version.split('.')[0], glib_req_version.split('.')[1]),
  '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_@0@_@1@'.format(glib_req_version.split('.')[0], glib_req_version.split('.')[1]),
  language: 'c'
)

prefix = get_option ('prefix')
libdir = get_option ('libdir')
libexecdir = get_option ('libexecdir')
bindir = get_option ('bindir')
datadir = get_option ('datadir')
servicedir = join_paths (datadir, 'dbus-1', 'services')
incdir = join_paths (prefix, get_option('includedir'), 'cloudproviders')
girdir= join_paths(datadir, 'gir-1.0')
typelibdir = join_paths(libdir, 'girepository-1.0')

gnome = import('gnome')

subdir ('src')
subdir ('test')
if get_option ('documentation')
    subdir ('docs')
endif
summary({
  'bindir': bindir,
  'libdir': libdir,
  'libexecdir': libexecdir,
  'datadir': datadir,
  'includedir': get_option('includedir'),
}, section: 'Directories')
summary({
  'Introspection': get_option('introspection'),
  'Vala bindings': get_option('vapigen'),
  'Documentation': get_option('documentation'),
  'Installed tests': get_option('installed-tests'),
}, section: 'Configuration')