mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
build: Remove the need to modify sources for new drivers
Instead of having to modify both fp_internal.h to list each driver definition structure, and core.c to add those drivers to arrays we can loop over, generate both of those using meson.
This commit is contained in:
@@ -128,7 +128,6 @@ foreach driver: drivers
|
||||
if driver == 'elan'
|
||||
drivers_sources += [ 'drivers/elan.c', 'drivers/elan.h' ]
|
||||
endif
|
||||
drivers_cflags += [ '-DENABLE_' + driver.to_upper() + '=1' ]
|
||||
endforeach
|
||||
|
||||
if aeslib
|
||||
@@ -146,6 +145,22 @@ if imaging_dep.found()
|
||||
other_sources += [ 'pixman.c' ]
|
||||
endif
|
||||
|
||||
libfprint_sources += configure_file(input: 'empty_file',
|
||||
output: 'drivers_definitions.h',
|
||||
capture: true,
|
||||
command: [
|
||||
'/bin/echo',
|
||||
drivers_struct_list
|
||||
])
|
||||
|
||||
libfprint_sources += configure_file(input: 'empty_file',
|
||||
output: 'drivers_arrays.h',
|
||||
capture: true,
|
||||
command: [
|
||||
'/bin/echo',
|
||||
drivers_primitive_array + '\n\n' + drivers_img_array
|
||||
])
|
||||
|
||||
deps = [ mathlib_dep, glib_dep, libusb_dep, nss_dep, imaging_dep ]
|
||||
libfprint = library('fprint',
|
||||
libfprint_sources + drivers_sources + nbis_sources + other_sources,
|
||||
|
||||
Reference in New Issue
Block a user