Skip to content

Commit

Permalink
Do not export symbols from private "/common/utils"
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
jrohel committed Jun 6, 2024
1 parent b53a69e commit b9be10d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
2 changes: 2 additions & 0 deletions libdnf5-cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b9be10d

Please sign in to comment.