meson: Fix CFLAGS use by using add_project_arguments

It seems that meson will not always apply the CFLAGS as defined through
the environment if "c_args=" is used in the default_options array for
the project() call.

Switching to add_project_arguments solves this problem.

See https://github.com/mesonbuild/meson/issues/8037
This commit is contained in:
Benjamin Berg
2020-11-28 15:33:34 +01:00
committed by Benjamin Berg
parent df568e1ce1
commit ec7376d7e6

View File

@ -5,7 +5,14 @@ project('fprintd', 'c',
'buildtype=debugoptimized',
'warning_level=1',
'c_std=gnu99',
'c_args=' + ' '.join([
],
meson_version: '>= 0.50.0')
gnome = import('gnome')
i18n = import('i18n')
cc = meson.get_compiler('c')
common_cflags = cc.get_supported_arguments([
'-fno-strict-aliasing',
'-Wall',
'-Wcast-align',
@ -43,14 +50,9 @@ project('fprintd', 'c',
'-Wtype-limits',
'-Wundef',
'-Wunused',
]),
],
meson_version: '>= 0.50.0')
])
add_project_arguments(common_cflags, language: 'c')
gnome = import('gnome')
i18n = import('i18n')
cc = meson.get_compiler('c')
host_system = host_machine.system()
glib_min_version = '2.56'
libfprint_min_version = '1.90.1'