Commit 7e70344b authored by Marco Trevisan's avatar Marco Trevisan

meson: Use add_project_arguments for common cflags

We were passing around the common cflags and setting them for each library
or executable, but this is just a repetition given we can just use
add_project_arguments for this.
parent 44af2173
......@@ -13,10 +13,7 @@ executable('gtk-libfprint-test',
include_directories: [
root_inc,
],
c_args: [
common_cflags,
'-DPACKAGE_VERSION="' + meson.project_version() + '"'
],
c_args: '-DPACKAGE_VERSION="' + meson.project_version() + '"',
install: true,
install_dir: bindir)
......
......@@ -6,8 +6,7 @@ foreach example: examples
dependencies: [ libfprint_dep, glib_dep ],
include_directories: [
root_inc,
],
c_args: common_cflags)
])
endforeach
executable('cpp-test',
......@@ -15,5 +14,4 @@ executable('cpp-test',
dependencies: libfprint_dep,
include_directories: [
root_inc,
],
c_args: common_cflags)
])
......@@ -188,7 +188,7 @@ libfprint = library('fprint',
drivers_sources + nbis_sources + other_sources,
soversion: soversion,
version: libversion,
c_args: common_cflags + drivers_cflags,
c_args: drivers_cflags,
include_directories: [
root_inc,
include_directories('nbis/include'),
......
......@@ -10,9 +10,6 @@ project('libfprint', [ 'c', 'cpp' ],
gnome = import('gnome')
add_project_arguments([ '-D_GNU_SOURCE' ], language: 'c')
add_project_arguments([ '-DG_LOG_DOMAIN="libfprint"' ], language: 'c')
libfprint_conf = configuration_data()
cc = meson.get_compiler('c')
......@@ -23,8 +20,6 @@ glib_min_version = '2.56'
glib_version_def = 'GLIB_VERSION_@0@_@1@'.format(
glib_min_version.split('.')[0], glib_min_version.split('.')[1])
common_cflags = cc.get_supported_arguments([
'-fgnu89-inline',
'-std=gnu99',
'-Wall',
'-Wtype-limits',
'-Wundef',
......@@ -34,7 +29,15 @@ common_cflags = cc.get_supported_arguments([
'-Wshadow',
'-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def,
'-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def,
'-D_GNU_SOURCE',
'-DG_LOG_DOMAIN="libfprint"',
])
c_cflags = cc.get_supported_arguments([
'-fgnu89-inline',
'-std=gnu99',
])
add_project_arguments(common_cflags + c_cflags, language: 'c')
add_project_arguments(common_cflags, language: 'cpp')
# maintaining compatibility with the previous libtool versioning
# current = binary - interface
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment