meson: Shuffle around driver/helper definition
This is in order to add a new SDCP helper without having to define more complicated logic.
This commit is contained in:
parent
e59d5451cc
commit
8d83e5eb38
2 changed files with 128 additions and 135 deletions
|
@ -78,117 +78,134 @@ nbis_sources = [
|
||||||
'nbis/mindtct/xytreps.c',
|
'nbis/mindtct/xytreps.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
aeslib = false
|
driver_sources = {
|
||||||
aesx660 = false
|
'upekts' :
|
||||||
aes3k = false
|
[ 'drivers/upekts.c', 'drivers/upek_proto.c' ],
|
||||||
drivers_sources = []
|
'upektc' :
|
||||||
drivers_cflags = []
|
[ 'drivers/upektc.c' ],
|
||||||
foreach driver: drivers
|
'upeksonly' :
|
||||||
if driver == 'upekts'
|
[ 'drivers/upeksonly.c' ],
|
||||||
drivers_sources += [ 'drivers/upekts.c', 'drivers/upek_proto.c' ]
|
'uru4000' :
|
||||||
endif
|
[ 'drivers/uru4000.c' ],
|
||||||
if driver == 'upektc'
|
'aes1610' :
|
||||||
drivers_sources += [ 'drivers/upektc.c' ]
|
[ 'drivers/aes1610.c' ],
|
||||||
endif
|
'aes1660' :
|
||||||
if driver == 'upeksonly'
|
[ 'drivers/aes1660.c' ],
|
||||||
drivers_sources += [ 'drivers/upeksonly.c' ]
|
'aes2501' :
|
||||||
endif
|
[ 'drivers/aes2501.c' ],
|
||||||
if driver == 'uru4000'
|
'aes2550' :
|
||||||
drivers_sources += [ 'drivers/uru4000.c' ]
|
[ 'drivers/aes2550.c' ],
|
||||||
endif
|
'aes2660' :
|
||||||
if driver == 'aes1610'
|
[ 'drivers/aes2660.c' ],
|
||||||
drivers_sources += [ 'drivers/aes1610.c' ]
|
'aes3500' :
|
||||||
aeslib = true
|
[ 'drivers/aes3500.c' ],
|
||||||
endif
|
'aes4000' :
|
||||||
if driver == 'aes1660'
|
[ 'drivers/aes4000.c' ],
|
||||||
drivers_sources += [ 'drivers/aes1660.c' ]
|
'vcom5s' :
|
||||||
aeslib = true
|
[ 'drivers/vcom5s.c' ],
|
||||||
aesx660 = true
|
'vfs101' :
|
||||||
endif
|
[ 'drivers/vfs101.c' ],
|
||||||
if driver == 'aes2501'
|
'vfs301' :
|
||||||
drivers_sources += [ 'drivers/aes2501.c' ]
|
[ 'drivers/vfs301.c', 'drivers/vfs301_proto.c' ],
|
||||||
aeslib = true
|
'vfs5011' :
|
||||||
endif
|
[ 'drivers/vfs5011.c' ],
|
||||||
if driver == 'aes2550'
|
'upektc_img' :
|
||||||
drivers_sources += [ 'drivers/aes2550.c' ]
|
[ 'drivers/upektc_img.c', 'drivers/upek_proto.c' ],
|
||||||
aeslib = true
|
'etes603' :
|
||||||
endif
|
[ 'drivers/etes603.c' ],
|
||||||
if driver == 'aes2660'
|
'vfs0050' :
|
||||||
drivers_sources += [ 'drivers/aes2660.c' ]
|
[ 'drivers/vfs0050.c' ],
|
||||||
aeslib = true
|
'elan' :
|
||||||
aesx660 = true
|
[ 'drivers/elan.c' ],
|
||||||
endif
|
'virtual_image' :
|
||||||
if driver == 'aes3500'
|
[ 'drivers/virtual-image.c' ],
|
||||||
drivers_sources += [ 'drivers/aes3500.c' ]
|
'virtual_device' :
|
||||||
aeslib = true
|
[ 'drivers/virtual-device.c' ],
|
||||||
aes3k = true
|
'virtual_device_storage' :
|
||||||
endif
|
[ 'drivers/virtual-device-storage.c' ],
|
||||||
if driver == 'aes4000'
|
'synaptics' :
|
||||||
drivers_sources += [ 'drivers/aes4000.c' ]
|
[ 'drivers/synaptics/synaptics.c', 'drivers/synaptics/bmkt_message.c' ],
|
||||||
aeslib = true
|
'goodixmoc' :
|
||||||
aes3k = true
|
[ 'drivers/goodixmoc/goodix.c', 'drivers/goodixmoc/goodix_proto.c' ],
|
||||||
endif
|
}
|
||||||
if driver == 'vcom5s'
|
|
||||||
drivers_sources += [ 'drivers/vcom5s.c' ]
|
helper_sources = {
|
||||||
endif
|
'aeslib' :
|
||||||
if driver == 'vfs101'
|
[ 'drivers/aeslib.c' ],
|
||||||
drivers_sources += [ 'drivers/vfs101.c' ]
|
'aesx660' :
|
||||||
endif
|
[ 'drivers/aesx660.c' ],
|
||||||
if driver == 'vfs301'
|
'aes3k' :
|
||||||
drivers_sources += [ 'drivers/vfs301.c', 'drivers/vfs301_proto.c' ]
|
[ 'drivers/aes3k.c' ],
|
||||||
endif
|
'virtual' :
|
||||||
if driver == 'vfs5011'
|
[ 'drivers/virtual-device-listener.c' ],
|
||||||
drivers_sources += [ 'drivers/vfs5011.c' ]
|
}
|
||||||
endif
|
|
||||||
if driver == 'upektc_img'
|
driver_helpers = {
|
||||||
drivers_sources += [ 'drivers/upektc_img.c', 'drivers/upek_proto.c' ]
|
'aes1610' : [ 'aeslib' ],
|
||||||
endif
|
'aes1660' : [ 'aeslib', 'aesx660' ],
|
||||||
if driver == 'etes603'
|
'aes2501' : [ 'aeslib' ],
|
||||||
drivers_sources += [ 'drivers/etes603.c' ]
|
'aes2550' : [ 'aeslib' ],
|
||||||
endif
|
'aes2660' : [ 'aeslib', 'aesx660' ],
|
||||||
if driver == 'vfs0050'
|
'aes3500' : [ 'aeslib', 'aes3k' ],
|
||||||
drivers_sources += [ 'drivers/vfs0050.c' ]
|
'aes4000' : [ 'aeslib', 'aes3k' ],
|
||||||
endif
|
'virtual_image' : [ 'virtual' ],
|
||||||
if driver == 'elan'
|
'virtual_device' : [ 'virtual' ],
|
||||||
drivers_sources += [ 'drivers/elan.c' ]
|
'virtual_device_storage' : [ 'virtual' ],
|
||||||
endif
|
}
|
||||||
if driver == 'virtual_image'
|
|
||||||
drivers_sources += [ 'drivers/virtual-image.c' ]
|
helpers = []
|
||||||
endif
|
foreach driver : drivers
|
||||||
if driver == 'virtual_device'
|
if driver in driver_helpers
|
||||||
drivers_sources += [ 'drivers/virtual-device.c' ]
|
foreach helper : driver_helpers[driver]
|
||||||
endif
|
if helper not in helpers
|
||||||
if driver == 'virtual_device_storage'
|
helpers += helper
|
||||||
drivers_sources += [ 'drivers/virtual-device-storage.c' ]
|
endif
|
||||||
endif
|
endforeach
|
||||||
if driver.startswith('virtual_')
|
|
||||||
drivers_sources += [ 'drivers/virtual-device-listener.c' ]
|
|
||||||
endif
|
|
||||||
if driver == 'synaptics'
|
|
||||||
drivers_sources += [
|
|
||||||
'drivers/synaptics/synaptics.c',
|
|
||||||
'drivers/synaptics/bmkt_message.c',
|
|
||||||
]
|
|
||||||
endif
|
|
||||||
if driver == 'goodixmoc'
|
|
||||||
drivers_sources += [
|
|
||||||
'drivers/goodixmoc/goodix.c',
|
|
||||||
'drivers/goodixmoc/goodix_proto.c',
|
|
||||||
]
|
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if aeslib
|
drivers_sources = []
|
||||||
drivers_sources += [ 'drivers/aeslib.c' ]
|
drivers_cflags = []
|
||||||
endif
|
foreach driver: drivers
|
||||||
if aesx660
|
drivers_sources += driver_sources[driver]
|
||||||
drivers_sources += ['drivers/aesx660.c' ]
|
endforeach
|
||||||
endif
|
foreach helper : helpers
|
||||||
if aes3k
|
drivers_sources += helper_sources[helper]
|
||||||
drivers_sources += ['drivers/aes3k.c' ]
|
endforeach
|
||||||
endif
|
|
||||||
|
|
||||||
other_sources = []
|
optional_deps = []
|
||||||
|
|
||||||
|
# Resolve extra dependencies
|
||||||
|
foreach i : helpers + drivers
|
||||||
|
driver = i
|
||||||
|
foreach d, helper : driver_helpers
|
||||||
|
if i in helpers
|
||||||
|
driver = d
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
if i == 'aes3k'
|
||||||
|
imaging_dep = dependency('pixman-1', required: false)
|
||||||
|
if not imaging_dep.found()
|
||||||
|
error('pixman is required for @0@ and possibly others'.format(driver))
|
||||||
|
endif
|
||||||
|
|
||||||
|
libfprint_conf.set10('HAVE_PIXMAN', true)
|
||||||
|
optional_deps += imaging_dep
|
||||||
|
elif i == 'uru4000'
|
||||||
|
nss_dep = dependency('nss', required: false)
|
||||||
|
if not nss_dep.found()
|
||||||
|
error('nss is required for uru4000')
|
||||||
|
endif
|
||||||
|
|
||||||
|
optional_deps += nss_dep
|
||||||
|
else
|
||||||
|
deps = []
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
endforeach
|
||||||
|
|
||||||
fp_enums = gnome.mkenums_simple('fp-enums',
|
fp_enums = gnome.mkenums_simple('fp-enums',
|
||||||
sources: libfprint_public_headers,
|
sources: libfprint_public_headers,
|
||||||
|
@ -243,10 +260,8 @@ deps = [
|
||||||
glib_dep,
|
glib_dep,
|
||||||
gobject_dep,
|
gobject_dep,
|
||||||
gusb_dep,
|
gusb_dep,
|
||||||
imaging_dep,
|
|
||||||
mathlib_dep,
|
mathlib_dep,
|
||||||
nss_dep,
|
] + optional_deps
|
||||||
]
|
|
||||||
|
|
||||||
# These are empty and only exist so that the include directories are created
|
# These are empty and only exist so that the include directories are created
|
||||||
# in the build tree. This silences a build time warning.
|
# in the build tree. This silences a build time warning.
|
||||||
|
@ -293,7 +308,6 @@ libfprint = shared_library(versioned_libname.split('lib')[1],
|
||||||
sources: [
|
sources: [
|
||||||
fp_enums,
|
fp_enums,
|
||||||
libfprint_sources,
|
libfprint_sources,
|
||||||
other_sources,
|
|
||||||
],
|
],
|
||||||
soversion: soversion,
|
soversion: soversion,
|
||||||
version: libversion,
|
version: libversion,
|
||||||
|
|
27
meson.build
27
meson.build
|
@ -151,29 +151,6 @@ else
|
||||||
endforeach
|
endforeach
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nss_dep = dependency('', required: false)
|
|
||||||
imaging_dep = dependency('', required: false)
|
|
||||||
libfprint_conf.set10('HAVE_PIXMAN', false)
|
|
||||||
foreach driver: drivers
|
|
||||||
if driver == 'uru4000'
|
|
||||||
nss_dep = dependency('nss', required: false)
|
|
||||||
if not nss_dep.found()
|
|
||||||
error('NSS is required for the URU4000/URU4500 driver')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if driver == 'aes3500' or driver == 'aes4000'
|
|
||||||
imaging_dep = dependency('pixman-1', required: false)
|
|
||||||
if not imaging_dep.found()
|
|
||||||
error('pixman is required for imaging support')
|
|
||||||
endif
|
|
||||||
|
|
||||||
libfprint_conf.set10('HAVE_PIXMAN', true)
|
|
||||||
endif
|
|
||||||
if not all_drivers.contains(driver)
|
|
||||||
error('Invalid driver \'' + driver + '\'')
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
|
|
||||||
supported_drivers = []
|
supported_drivers = []
|
||||||
foreach driver: drivers
|
foreach driver: drivers
|
||||||
if build_machine.endian() == 'little' or driver in endian_independent_drivers
|
if build_machine.endian() == 'little' or driver in endian_independent_drivers
|
||||||
|
@ -210,9 +187,11 @@ if get_option('gtk-examples')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Some dependency resolving happens inside here
|
||||||
|
subdir('libfprint')
|
||||||
|
|
||||||
configure_file(output: 'config.h', configuration: libfprint_conf)
|
configure_file(output: 'config.h', configuration: libfprint_conf)
|
||||||
|
|
||||||
subdir('libfprint')
|
|
||||||
subdir('examples')
|
subdir('examples')
|
||||||
if get_option('doc')
|
if get_option('doc')
|
||||||
gnome = import('gnome')
|
gnome = import('gnome')
|
||||||
|
|
Loading…
Reference in a new issue