'-Wno-format-signedness',
]
-possible_cc_flags = [
+possible_common_cc_flags = [
'-Werror=undef',
'-Wlogical-op',
'-Wmissing-include-dirs',
'-Winit-self',
'-Wfloat-equal',
'-Wsuggest-attribute=noreturn',
- '-Werror=missing-prototypes',
'-Werror=implicit-function-declaration',
- '-Werror=missing-declarations',
'-Werror=return-type',
'-Werror=incompatible-pointer-types',
'-Werror=format=2',
'-fdiagnostics-show-option',
'-fno-strict-aliasing',
'-fvisibility=hidden',
- '-fstack-protector',
- '-fstack-protector-strong',
'--param=ssp-buffer-size=4',
]
# busywork. See https://github.com/systemd/systemd/pull/19226.
if cc.get_id() == 'gcc' and (not '02'.contains(get_option('optimization')) or
cc.version().version_compare('<10'))
- possible_cc_flags += '-Wno-maybe-uninitialized'
+ possible_common_cc_flags += '-Wno-maybe-uninitialized'
endif
# --as-needed and --no-undefined are provided by meson by default,
]
if cc.get_id() == 'clang'
- possible_cc_flags += [
+ possible_common_cc_flags += [
'-Wno-typedef-redefinition',
'-Wno-gnu-variable-sized-type-not-at-end',
]
endif
if get_option('buildtype') != 'debug'
- possible_cc_flags += [
+ possible_common_cc_flags += [
'-ffunction-sections',
'-fdata-sections',
]
possible_link_flags += '-Wl,--gc-sections'
endif
+possible_cc_flags = possible_common_cc_flags + [
+ '-Werror=missing-declarations',
+ '-Werror=missing-prototypes',
+ '-fstack-protector',
+ '-fstack-protector-strong',
+]
+
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')
endif
if have_gnu_efi
- compile_args = ['-Wall',
- '-Wextra',
- '-std=gnu99',
- '-nostdlib',
- '-fpic',
- '-fshort-wchar',
+ compile_args = cc.get_supported_arguments(
+ basic_disabled_warnings +
+ possible_common_cc_flags + [
'-ffreestanding',
- '-fno-strict-aliasing',
'-fno-stack-protector',
+ '-fpic',
+ '-fshort-wchar',
+ '-Wall',
+ '-Wextra',
'-Wsign-compare',
- '-Wno-missing-field-initializers',
- '-isystem', efi_incdir,
- '-isystem', join_paths(efi_incdir, gnu_efi_path_arch),
- '-I', fundamental_path,
- '-DSD_BOOT',
- '-include', efi_config_h,
- '-include', version_h]
+ ]
+ ) + [
+ '-nostdlib',
+ '-std=gnu99',
+ '-isystem', efi_incdir,
+ '-isystem', join_paths(efi_incdir, gnu_efi_path_arch),
+ '-I', fundamental_path,
+ '-DSD_BOOT',
+ '-include', efi_config_h,
+ '-include', version_h,
+ ]
if efi_arch == 'x86_64'
compile_args += ['-mno-red-zone',
'-mno-sse',