1project('gnome-color-manager', 'c',
2  version : '3.36.0',
3  license : 'GPL-2.0+',
4  default_options : ['warning_level=1'],
5  meson_version : '>=0.46.0'
6)
7
8conf = configuration_data()
9conf.set_quoted('PACKAGE_NAME', meson.project_name())
10conf.set_quoted('PACKAGE_VERSION', meson.project_version())
11
12# get suported warning flags
13test_args = [
14  '-fstack-protector-strong',
15  '-Waggregate-return',
16  '-Warray-bounds',
17  '-Wcast-align',
18  '-Wclobbered',
19  '-Wdeclaration-after-statement',
20  '-Wempty-body',
21  '-Wextra',
22  '-Wformat=2',
23  '-Wformat-nonliteral',
24  '-Wformat-security',
25  '-Wformat-signedness',
26  '-Wignored-qualifiers',
27  '-Wimplicit-function-declaration',
28  '-Winit-self',
29  '-Winline',
30  '-Wmissing-declarations',
31  '-Wmissing-format-attribute',
32  '-Wmissing-include-dirs',
33  '-Wmissing-noreturn',
34  '-Wmissing-parameter-type',
35  '-Wmissing-prototypes',
36  '-Wnested-externs',
37  '-Wno-discarded-qualifiers',
38  '-Wno-missing-field-initializers',
39  '-Wno-strict-aliasing',
40  '-Wno-suggest-attribute=format',
41  '-Wno-unused-parameter',
42  '-Wno-cast-function-type',
43  '-Wno-deprecated-declarations',
44  '-Wold-style-definition',
45  '-Woverride-init',
46  '-Wpacked',
47  '-Wpointer-arith',
48  '-Wredundant-decls',
49  '-Wreturn-type',
50  '-Wshadow',
51  '-Wsign-compare',
52  '-Wstrict-aliasing',
53  '-Wstrict-prototypes',
54  '-Wswitch-default',
55  '-Wtype-limits',
56  '-Wundef',
57  '-Wuninitialized',
58  '-Wunused-but-set-variable',
59  '-Wwrite-strings'
60]
61cc = meson.get_compiler('c')
62foreach arg: test_args
63  if cc.has_argument(arg)
64    add_project_arguments(arg, language : 'c')
65  endif
66endforeach
67
68# enable full RELRO where possible
69# FIXME: until https://github.com/mesonbuild/meson/issues/1140 is fixed
70test_link_args = [
71  '-Wl,-z,relro',
72  '-Wl,-z,now',
73]
74foreach arg: test_link_args
75  if cc.has_link_argument(arg)
76    add_project_link_arguments(arg, language : 'c')
77  endif
78endforeach
79
80prefixed_bindir = join_paths(get_option('prefix'), get_option('bindir'))
81prefixed_localedir = join_paths(get_option('prefix'), get_option('localedir'))
82prefixed_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
83prefixed_mandir = join_paths(get_option('prefix'), get_option('mandir'))
84prefixed_datadir = join_paths(get_option('prefix'), get_option('datadir'))
85prefixed_pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'gnome-color-manager')
86
87libgio = dependency('gio-2.0', version : '>= 2.25.9')
88libgtk = dependency('gtk+-3.0', version : '>= 2.91.0')
89libcolord = dependency('colord', version : '>= 1.3.1')
90libm = cc.find_library('m', required: false)
91liblcms = dependency('lcms2', version : '>= 2.2')
92
93gnome = import('gnome')
94i18n = import('i18n')
95
96conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
97conf.set_quoted('LOCALEDIR', prefixed_localedir)
98conf.set_quoted('DATADIR', prefixed_datadir)
99conf.set_quoted('PKGDATADIR', prefixed_pkgdatadir)
100conf.set_quoted('BINDIR', prefixed_bindir)
101conf.set_quoted('LIBEXECDIR', prefixed_libexecdir)
102configure_file(
103  output : 'config.h',
104  configuration : conf
105)
106
107subdir('data')
108subdir('help')
109subdir('man')
110subdir('po')
111subdir('src')
112
113# FIXME: remove when https://github.com/mesonbuild/meson/issues/837 fixed
114meson.add_install_script('meson_post_install.sh')
115