Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize build process: Do not create object files archive library libdnf5_static.a #2004

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented Jan 13, 2025

Closes: #2003

The "libdnf5_static.a" object files archive was not packaged. It was only used in unit tests of the "libdnf5" library. The use of the archive in the "libdnf5" unit tests was intentional. The unit tests call private methods that have hidden symbols not exported by the shared library.

Now the INTERFACE library is defined instead of the object files archive. It specify usage requirements for dependents but does not produce a library artifact on disk. The "libdnf5" unit tests link directly to the object files without the need for an intermediate archive.

And removes `common` from the `dnf5daemon-server` dependency. It is not used.
The "libdnf5_static.a" object files archive was not packaged. It was
only used in unit tests of the "libdnf5" library. The use of the archive
in the "libdnf5" unit tests was intentional. The unit tests call private
methods that have hidden symbols not exported by the shared library.

Now the `INTERFACE` library is defined instead of the object files
archive. It specify usage requirements for dependents but does not
produce a library artifact on disk. The "libdnf5" unit tests link
directly to the object files without the need for an intermediate
archive.
Maybe increasing the minimum CMake version is not necessary, but
the CMake documentation states:
Referencing `$<TARGET_OBJECTS>` in target_link_libraries calls worked in
versions of CMake prior to 3.21 for some cases, but was not fully
supported.
@jrohel jrohel force-pushed the no_create_libdnf5_object_archive branch from f6d2f7f to ec9cd41 Compare January 13, 2025 14:57
@Conan-Kudo Conan-Kudo added this pull request to the merge queue Jan 14, 2025
Merged via the queue into rpm-software-management:main with commit df97dfb Jan 14, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize build process - Do not create object files archive library libdnf5_static.a
2 participants