mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
build: Generalize spi drivers detection
Don't be limited to elan only
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
spi_sources = []
|
spi_sources = []
|
||||||
spi_headers = []
|
spi_headers = []
|
||||||
|
|
||||||
if 'elanspi' in drivers
|
if enabled_spi_drivers.length() > 0
|
||||||
spi_headers = ['fpi-spi-transfer.h']
|
spi_headers = ['fpi-spi-transfer.h']
|
||||||
spi_sources = ['fpi-spi-transfer.c']
|
spi_sources = ['fpi-spi-transfer.c']
|
||||||
endif
|
endif
|
||||||
|
|||||||
23
meson.build
23
meson.build
@@ -97,6 +97,9 @@ cairo_dep = dependency('cairo', required: false)
|
|||||||
# introspection scanning and Gio-2.0.gir
|
# introspection scanning and Gio-2.0.gir
|
||||||
gobject_introspection = dependency('gobject-introspection-1.0', required: get_option('introspection'))
|
gobject_introspection = dependency('gobject-introspection-1.0', required: get_option('introspection'))
|
||||||
|
|
||||||
|
# SPI
|
||||||
|
have_spi = host_machine.system() == 'linux'
|
||||||
|
|
||||||
# Drivers
|
# Drivers
|
||||||
drivers = get_option('drivers').split(',')
|
drivers = get_option('drivers').split(',')
|
||||||
virtual_drivers = [
|
virtual_drivers = [
|
||||||
@@ -137,9 +140,12 @@ default_drivers = [
|
|||||||
'focaltech_moc',
|
'focaltech_moc',
|
||||||
]
|
]
|
||||||
|
|
||||||
# SPI
|
spi_drivers = [
|
||||||
if host_machine.system() == 'linux'
|
'elanspi'
|
||||||
default_drivers += ['elanspi']
|
]
|
||||||
|
|
||||||
|
if have_spi
|
||||||
|
default_drivers += spi_drivers
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# FIXME: All the drivers should be fixed by adjusting the byte order.
|
# FIXME: All the drivers should be fixed by adjusting the byte order.
|
||||||
@@ -178,6 +184,17 @@ if drivers == [ 'default' ]
|
|||||||
drivers = default_drivers
|
drivers = default_drivers
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
enabled_spi_drivers = []
|
||||||
|
foreach driver : spi_drivers
|
||||||
|
if driver in drivers
|
||||||
|
enabled_spi_drivers += driver
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
if enabled_spi_drivers.length() > 0 and not have_spi
|
||||||
|
error('SPI drivers @0@ are not supported'.format(enabled_spi_drivers))
|
||||||
|
endif
|
||||||
|
|
||||||
driver_helper_mapping = {
|
driver_helper_mapping = {
|
||||||
'aes1610' : [ 'aeslib' ],
|
'aes1610' : [ 'aeslib' ],
|
||||||
'aes1660' : [ 'aeslib', 'aesx660' ],
|
'aes1660' : [ 'aeslib', 'aesx660' ],
|
||||||
|
|||||||
Reference in New Issue
Block a user