File: meson.build

package info (click to toggle)
bazaar 0.7.8-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,396 kB
  • sloc: ansic: 49,466; sh: 685; xml: 327; python: 87; makefile: 6
file content (124 lines) | stat: -rw-r--r-- 3,664 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
project('bazaar', 'c',
          version: run_command('version.sh', 'get-vcs').stdout().strip(),
    meson_version: '>= 1.0.0',
  default_options: [
    'warning_level=2',
    'werror=false',
    'c_std=gnu11',
  ],
)

i18n = import('i18n')
if get_option('im_a_translator')
  subdir('po')
else
  gnome = import('gnome')
  cc = meson.get_compiler('c')

  config_h = configuration_data()

  config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
  config_h.set_quoted('GETTEXT_PACKAGE', 'bazaar')
  config_h.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
  config_h.set_quoted('DONATE_LINK', 'https://ko-fi.com/kolunmi')
  config_h.set_quoted('RELEASE_PAGE', run_command('version.sh', 'get-gh-release').stdout().strip())

  dl_worker_bin_name = 'bazaar-dl-worker'
  config_h.set_quoted('DL_WORKER_BIN_NAME', dl_worker_bin_name)

  if get_option('hardcoded_main_config_path') != ''
    config_h.set_quoted('HARDCODED_MAIN_CONFIG', get_option('hardcoded_main_config_path'))
  endif
  if get_option('hardcoded_blocklist_path') != ''
    config_h.set_quoted('HARDCODED_BLOCKLIST', get_option('hardcoded_blocklist_path'))
  endif
  if get_option('hardcoded_content_config_path') != ''
    config_h.set_quoted('HARDCODED_CONTENT_CONFIG', get_option('hardcoded_content_config_path'))
  endif
  if get_option('sandboxed_libflatpak')
    config_h.set_quoted('SANDBOXED_LIBFLATPAK', '1')
  endif

  if get_option('development')
    config_h.set10('DEVELOPMENT_BUILD', get_option('development'))
  endif

  configure_file(output: 'config.h', configuration: config_h)
  add_project_arguments(['-I' + meson.project_build_root()], language: 'c')

  project_c_args = []
  test_c_args = [
    '-Wcast-align',
    '-Wdeclaration-after-statement',
    '-Werror=address',
    '-Werror=array-bounds',
    '-Werror=empty-body',
    '-Werror=implicit',
    '-Werror=implicit-function-declaration',
    '-Werror=incompatible-pointer-types',
    '-Werror=init-self',
    '-Werror=int-conversion',
    '-Werror=int-to-pointer-cast',
    '-Werror=main',
    '-Werror=misleading-indentation',
    '-Werror=missing-braces',
    '-Werror=missing-include-dirs',
    '-Werror=nonnull',
    '-Werror=overflow',
    '-Werror=parenthesis',
    '-Werror=pointer-arith',
    '-Werror=pointer-to-int-cast',
    '-Werror=redundant-decls',
    '-Werror=return-type',
    '-Werror=sequence-point',
    '-Werror=shadow',
    '-Werror=strict-prototypes',
    '-Werror=trigraphs',
    '-Werror=undef',
    '-Werror=write-strings',
    '-Wformat-nonliteral',
    '-Wignored-qualifiers',
    '-Wimplicit-function-declaration',
    '-Wlogical-op',
    '-Wmissing-declarations',
    '-Wmissing-format-attribute',
    '-Wmissing-include-dirs',
    '-Wmissing-noreturn',
    '-Wnested-externs',
    '-Wno-cast-function-type',
    '-Wno-dangling-pointer',
    '-Wno-missing-field-initializers',
    '-Wno-sign-compare',
    '-Wno-unused-parameter',
    '-Wold-style-definition',
    '-Wpointer-arith',
    '-Wredundant-decls',
    '-Wstrict-prototypes',
    '-Wswitch-default',
    '-Wswitch-enum',
    '-Wundef',
    '-Wuninitialized',
    '-Wunused',
    '-fno-strict-aliasing',
    ['-Werror=format-security', '-Werror=format=2'],
  ]
  if get_option('buildtype') != 'plain'
    test_c_args += '-fstack-protector-strong'
  endif
  foreach arg: test_c_args
    if cc.has_multi_arguments(arg)
      project_c_args += arg
    endif
  endforeach
  add_project_arguments(project_c_args, language: 'c')

  subdir('data')
  subdir('src')
  subdir('po')

  gnome.post_install(
    glib_compile_schemas: true,
    gtk_update_icon_cache: true,
    update_desktop_database: true,
  )
endif