'prefix=/usr',
'sysconfdir=/etc',
'localstatedir=/var',
+ 'warning_level=2',
],
meson_version : '>= 0.46',
)
if add_languages('cpp', required : fuzzer_build)
# Used only for tests
- cxx_cmd = ' '.join(meson.get_compiler('cpp').cmd_array())
+ cxx = meson.get_compiler('cpp')
+ cxx_cmd = ' '.join(cxx.cmd_array())
else
cxx_cmd = ''
endif
fuzzing_engine = meson.get_compiler('cpp').find_library(get_option('fuzzbuzz-engine'), dirs: get_option('fuzzbuzz-engine-dir'))
endif
+# Those generate many false positives, and we do not want to change the code to
+# avoid them.
+basic_disabled_warnings = [
+ '-Wno-unused-parameter',
+ '-Wno-missing-field-initializers',
+ '-Wno-unused-result',
+ '-Wno-format-signedness',
+]
+if get_option('b_ndebug') == 'true'
+ # With asserts disabled with get a bunch of warnings about variables which
+ # are used only in the asserts. This is not useful at all, so let's just silence
+ # those warnings.
+ basic_disabled_warnings += [
+ '-Wno-unused-variable',
+ '-Wno-unused-but-set-variable',
+ ]
+endif
+
possible_cc_flags = [
- '-Wextra',
'-Werror=undef',
'-Wlogical-op',
'-Wmissing-include-dirs',
'-Wnested-externs',
# negative arguments are correctly detected starting with meson 0.46.
- '-Wno-unused-parameter',
- '-Wno-missing-field-initializers',
- '-Wno-unused-result',
- '-Wno-format-signedness',
'-Wno-error=#warnings', # clang
'-Wno-string-plus-int', # clang
possible_link_flags += '-Wl,--gc-sections'
endif
-if get_option('b_ndebug') == 'true'
- # With asserts disabled with get a bunch of warnings about variables which
- # are used only in the asserts. This is not useful at all, so let's just silence
- # those warnings.
- possible_cc_flags += [
- '-Wno-unused-variable',
- '-Wno-unused-but-set-variable',
- ]
-endif
-
+add_project_arguments(cc.get_supported_arguments(basic_disabled_warnings), language : 'c')
add_project_arguments(cc.get_supported_arguments(possible_cc_flags), language : 'c')
add_project_link_arguments(cc.get_supported_link_arguments(possible_link_flags), language : 'c')
add_project_arguments('-Werror=shadow', language : 'c')
endif
+if cxx_cmd != ''
+ add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
+endif
+
cpp = ' '.join(cc.cmd_array()) + ' -E'
has_wstringop_truncation = cc.has_argument('-Wstringop-truncation')
conf.set10('VALGRIND', get_option('valgrind'))
conf.set10('LOG_TRACE', get_option('log-trace'))
+default_user_path = get_option('user-path')
+if default_user_path != ''
+ conf.set_quoted('DEFAULT_USER_PATH', default_user_path)
+ default_user_path_display = default_user_path
+else
+ # meson 0.49 fails when ?: is used in .format()
+ default_user_path_display = '(same as system services)'
+endif
+
+
#####################################################################
threads = dependency('threads')
make_man_index_py = find_program('tools/make-man-index.py')
xml_helper_py = find_program('tools/xml_helper.py')
hwdb_update_sh = find_program('tools/meson-hwdb-update.sh')
+autosuspend_update_sh = find_program('tools/meson-autosuspend-update.sh')
subdir('sysctl.d')
subdir('sysusers.d')
'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme),
'default KillUserProcesses setting: @0@'.format(kill_user_processes),
'default locale: @0@'.format(default_locale),
+ 'default user $PATH: @0@'.format(default_user_path_display),
'systemd service watchdog: @0@'.format(watchdog_opt)]
alt_dns_servers = '\n '.join(dns_servers.split(' '))