Do not export symbols from private "/common/utils"

Libraries and applications (libdnf5.so, dnf5, dnf5daemon-client...) use
(and statically link) private utilities from "/common/utils".
And they also publicly export the symbols of these private utilities.

This modification hides the symbols of utilities linked from
"/common/utils".
This commit is contained in:
Jaroslav Rohel 2024-05-21 07:15:47 +02:00 committed by kolage
parent 62b8503e52
commit 9b8f32dbb6
2 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ include_directories(.)
add_library(common OBJECT ${COMMON_SOURCES})
set_property(TARGET common PROPERTY POSITION_INDEPENDENT_CODE ON)
set_target_properties(common PROPERTIES C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden)
# required by clang
target_link_libraries(common PUBLIC stdc++)

View File

@ -33,6 +33,8 @@ install(TARGETS libdnf5-cli LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
# link libraries and set pkg-config requires
target_link_libraries(libdnf5-cli PRIVATE common)
target_link_libraries(libdnf5-cli PUBLIC libdnf5)
pkg_check_modules(LIBFMT REQUIRED fmt)