diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-01-05 20:19:21 +0100 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2025-02-14 19:45:12 +0100 |
| commit | 6de55404ca8ce296ccf14880c6115b6d8eb4e0b9 (patch) | |
| tree | b8dcdba95752e58d3fac13f378ed6268f02a6c66 /apt-pkg | |
| parent | ee04d676f6642d1c0b385ff588844f6b8ba85e73 (diff) | |
apt-pkg: Avoid exporting any optional symbols
Diffstat (limited to 'apt-pkg')
| -rw-r--r-- | apt-pkg/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | apt-pkg/versionscript.in | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/apt-pkg/CMakeLists.txt b/apt-pkg/CMakeLists.txt index 4c036cc67..7aaacd9d9 100644 --- a/apt-pkg/CMakeLists.txt +++ b/apt-pkg/CMakeLists.txt @@ -36,6 +36,7 @@ message(STATUS "Building libapt-pkg ${MAJOR} (release ${MINOR})") set(APT_PKG_MAJOR ${MAJOR} PARENT_SCOPE) # exporting for methods/CMakeLists.txt configure_file(apt-pkg.pc.in ${CMAKE_CURRENT_BINARY_DIR}/apt-pkg.pc @ONLY) +configure_file(versionscript.in ${CMAKE_CURRENT_BINARY_DIR}/versionscript @ONLY) # Definition of the C++ files used to build the library - note that this # is expanded at CMake time, so you have to rerun cmake if you add or remove @@ -45,7 +46,6 @@ file(GLOB_RECURSE headers "*.h") # Create a library using the C++ files add_library(apt-pkg SHARED ${library}) -add_dependencies(apt-pkg apt-pkg-versionscript) # Link the library and set the SONAME target_include_directories(apt-pkg PRIVATE ${ZLIB_INCLUDE_DIRS} @@ -77,7 +77,7 @@ target_link_libraries(apt-pkg set_target_properties(apt-pkg PROPERTIES VERSION ${MAJOR}.${MINOR}) set_target_properties(apt-pkg PROPERTIES SOVERSION ${MAJOR}) set_target_properties(apt-pkg PROPERTIES CXX_VISIBILITY_PRESET hidden) -add_version_script(apt-pkg) +target_link_libraries(apt-pkg PRIVATE -Wl,-version-script="${CMAKE_CURRENT_BINARY_DIR}/versionscript") # Install the library and the header files install(TARGETS apt-pkg LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/apt-pkg/versionscript.in b/apt-pkg/versionscript.in new file mode 100644 index 000000000..aea98abc7 --- /dev/null +++ b/apt-pkg/versionscript.in @@ -0,0 +1,16 @@ +APTPKG_@MAJOR@ +{ +global: + *; +local: + extern "C++" { + std::*; + typeinfo?for?std::*; + vtable?for?std::*; + typeinfo?name?for?std::*; + guard?variable?for?std::*; + void?std::*; + bool?std::*; + __gnu_cxx::*; + }; +}; |
