tod: Force libfprint-tod to be a shared library and link whole with private

Also unset the private library if set and make libfprint to only link
with the tod one.

This fixes the issue we had with wrong symbols shared by multiple
libraries
This commit is contained in:
Marco Trevisan (Treviño)
2022-10-13 19:44:40 +02:00
parent c04d15bbf1
commit c36310fed1
+6 -2
View File
@@ -35,7 +35,7 @@ foreach source: libfprint_private_sources
tod_sources += '..' / source tod_sources += '..' / source
endforeach endforeach
libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod', libfprint_tod = shared_library(versioned_libname.split('lib')[1] + '-tod',
c_args: [ c_args: [
'-DTOD_LIBRARY=1', '-DTOD_LIBRARY=1',
'-include', '@0@'.format(files('tod-symbols.h')[0]), '-include', '@0@'.format(files('tod-symbols.h')[0]),
@@ -50,7 +50,7 @@ libfprint_tod = library(versioned_libname.split('lib')[1] + '-tod',
'-Wl,--unresolved-symbols=ignore-in-object-files' '-Wl,--unresolved-symbols=ignore-in-object-files'
], ],
link_depends: mapfile, link_depends: mapfile,
link_with: [libfprint_private], link_whole: [libfprint_tod_private],
dependencies: deps, dependencies: deps,
install: true) install: true)
@@ -104,3 +104,7 @@ install_headers(tod_headers,
install_headers(tod_local_headers, install_headers(tod_local_headers,
subdir: tod_subpath / 'tod', subdir: tod_subpath / 'tod',
) )
# Replace the libfprint private instance with the TOD one in this case as we
# contain already all the symbols.
libfprint_private = libfprint_tod