meson.build 1.89 KB
Newer Older
Andrea Schaefer's avatar
Andrea Schaefer committed
1
project('chatty', 'c',        version: '0.1.1',
2
  meson_version: '>= 0.41.0',
Andrea Schaefer's avatar
Andrea Schaefer committed
3 4 5 6 7 8 9
)

i18n = import('i18n')

config_h = configuration_data()
config_h.set_quoted('GETTEXT_PACKAGE', 'purism-chatty')
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'), get_option('localedir')))
10 11
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
Andrea Schaefer's avatar
Andrea Schaefer committed
12 13 14 15 16 17 18 19
configure_file(
  output: 'chatty-config.h',
  configuration: config_h,
)
add_project_arguments([
  '-I' + meson.build_root(),
], language: 'c')

20 21 22 23 24 25 26
cc = meson.get_compiler('c')

global_c_args = []
test_c_args = [
  '-Wcast-align',
  '-Wdate-time',
  '-Wdeclaration-after-statement',
Andrea Schaefer's avatar
Andrea Schaefer committed
27
  ['-Werror=format-security', '-Werror=-format-nonliteral'],
28 29 30 31 32 33
  '-Wendif-labels',
  '-Werror=incompatible-pointer-types',
  '-Werror=missing-declarations',
  '-Werror=overflow',
  '-Werror=return-type',
  '-Werror=shift-count-overflow',
34
  '-Werror=shift-overflow=1',
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
  '-Werror=implicit-fallthrough=3',
  '-Wfloat-equal',
  '-Wformat-nonliteral',
  '-Wformat-security',
  '-Winit-self',
  '-Wmaybe-uninitialized',
  '-Wmissing-field-initializers',
  '-Wmissing-include-dirs',
  '-Wmissing-noreturn',
  '-Wnested-externs',
  '-Wno-missing-field-initializers',
  '-Wno-sign-compare',
  '-Wno-strict-aliasing',
  '-Wno-unused-parameter',
  '-Wold-style-definition',
  '-Wpointer-arith',
  '-Wredundant-decls',
  '-Wshadow',
  '-Wstrict-prototypes',
  '-Wswitch-default',
  '-Wswitch-enum',
  '-Wtype-limits',
  '-Wundef',
  '-Wunused-function',
]
if get_option('buildtype') != 'plain'
61
  test_c_args += '-fstack-protector-strong'
62 63 64 65 66 67 68 69 70 71 72 73
endif

foreach arg: test_c_args
  if cc.has_multi_arguments(arg)
    global_c_args += arg
  endif
endforeach
add_project_arguments(
  global_c_args,
  language: 'c'
)

74 75
libebook_dep = dependency('libebook-contacts-1.2')

Andrea Schaefer's avatar
Andrea Schaefer committed
76 77 78 79 80
subdir('data')
subdir('src')
subdir('po')

meson.add_install_script('build-aux/meson/postinstall.py')