summaryrefslogtreecommitdiff
path: root/meson.build
blob: d8e9d7e6417170c913609e417969acc3f1fd36cf (plain)
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
project('libgweather', 'c',
  version: '4.1.2',
  license: 'GPL-2.0-or-later',
  meson_version: '>= 0.57.0',
  default_options: [
    'warning_level=2',
    'buildtype=debugoptimized',
    'c_std=gnu99',
  ],
)

libgweather_version = meson.project_version().split('.')
libgweather_api = 4
libgweather_api_version = '@0@.0'.format(libgweather_api)
libgweather_full_version = '@0@-@1@'.format(meson.project_name(), libgweather_api_version)

pkgconfig = import('pkgconfig')
gnome = import('gnome')
i18n = import('i18n')

prefix = get_option('prefix')

bindir = prefix / get_option('bindir')
datadir = prefix / get_option('datadir')
libdir = prefix / get_option('libdir')
includedir = prefix / get_option('includedir')
libexecdir = prefix / get_option('libexecdir')
sysconfdir = prefix / get_option('sysconfdir')

pkgdatadir = datadir / 'libgweather-4'
pkglibdir = libdir / 'libgweather-4'

glib_req_version = '>= 2.68.0'
libxml_req_version = '>= 2.6.0'

GETTEXT_PACKAGE = libgweather_full_version
LOCATIONS_GETTEXT_PACKAGE = libgweather_full_version + '-locations'

c_compiler = meson.get_compiler('c')

pylint = find_program('pylint-3', 'pylint3', 'pylint', required: false)
nomalloc = environment({'MALLOC_PERTURB_': '0'})
pylint_flags = [
  '-d', 'C0111',
  '-d', 'W0511',
  '-d', 'F0401',
  '-d', 'C0326',
]

py = import('python').find_installation('python3', modules: ['gi'])
gen_locations_variant = find_program('build-aux/meson/gen_locations_variant.py')

g_ir_scanner = find_program('g-ir-scanner', required: get_option('introspection'))
build_gir = get_option('introspection') and g_ir_scanner.found() and not meson.is_cross_build()
build_docs = get_option('gtk_doc') and build_gir

subdir('data')
subdir('schemas')
subdir('libgweather')
subdir('doc')
subdir('po')
subdir('po-locations')

gnome.post_install(
  glib_compile_schemas: true,
)

summary({
    'prefix': prefix,
    'libdir': libdir,
    'datadir': datadir,
    'zone info': get_option('zoneinfo_dir'),
  },
  section: 'Directories',
)

summary({
    'Debug': get_option('debug'),
    'Optimization': get_option('optimization'),
    'Use libsoup-2': get_option('soup2'),
    'Introspection': build_gir,
    'Generate VAPI': build_vapi,
    'API reference': build_docs,
  },
  section: 'Build',
  bool_yn: true,
)