fwupd/plugins/thunderbolt/meson.build
Richard Hughes 16b463334e Export the generic Intel Thunderbolt firmware format
This is being used for other products, e.g. USB4 docks.

If non-Intel firmware is being used (e.g. ASMedia) then the explicit
calls to `fu_intel_thunderbolt_nvm_new()` can be changed to something
like `fu_firmware_new_from_gtypes()` with all the formats listed.
2022-08-30 14:20:14 +01:00

77 lines
1.9 KiB
Meson

if gudev.found()
cargs = ['-DG_LOG_DOMAIN="FuPluginThunderbolt"']
plugin_quirks += join_paths(meson.current_source_dir(), 'thunderbolt.quirk')
fu_plugin_thunderbolt = shared_module('fu_plugin_thunderbolt',
fu_hash,
sources: [
'fu-plugin-thunderbolt.c',
'fu-thunderbolt-common.c',
'fu-thunderbolt-device.c',
'fu-thunderbolt-retimer.c',
'fu-thunderbolt-controller.c',
],
include_directories: [
root_incdir,
fwupd_incdir,
fwupdplugin_incdir,
],
install: true,
install_dir: plugin_dir,
link_with: [
fwupd,
fwupdplugin,
],
c_args: cargs,
dependencies: [
plugin_deps,
],
)
install_data(['thunderbolt.conf'],
install_dir: join_paths(sysconfdir, 'fwupd')
)
# we use functions from 2.52 in the tests
if get_option('tests') and run_sanitize_unsafe_tests and umockdev.found() and gio.version().version_compare('>= 2.52')
env = environment()
env.set('G_TEST_SRCDIR', meson.current_source_dir())
env.set('G_TEST_BUILDDIR', meson.current_build_dir())
env.set('FWUPD_LOCALSTATEDIR', '/tmp/fwupd-self-test/var')
env.set('FWUPD_DATADIR_QUIRKS', meson.current_source_dir())
e = executable(
'thunderbolt-self-test',
fu_hash,
sources: [
'fu-self-test.c',
'fu-plugin-thunderbolt.c',
'fu-thunderbolt-common.c',
'fu-thunderbolt-device.c',
'fu-thunderbolt-retimer.c',
'fu-thunderbolt-controller.c',
],
include_directories: [
root_incdir,
fwupd_incdir,
fwupdplugin_incdir,
],
dependencies: [
gudev,
plugin_deps,
umockdev,
],
link_with: [
fwupd,
fwupdplugin,
],
c_args: cargs
)
if get_option('b_sanitize') == 'address'
env.prepend('LD_PRELOAD', 'libasan.so.5', 'libumockdev-preload.so.0', separator: ' ')
else
env.prepend('LD_PRELOAD', 'libumockdev-preload.so.0')
endif
test('thunderbolt-self-test', e, env: env, timeout: 120)
endif
endif