Skip to content

[libunwind] Introduce LIBUNWIND_LIBRARY_VERSION and drop outdated Apple flags #110178

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libunwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ cmake_dependent_option(LIBUNWIND_INSTALL_SHARED_LIBRARY
"Install the shared libunwind library." ON
"LIBUNWIND_ENABLE_SHARED;LIBUNWIND_INSTALL_LIBRARY" OFF)

set(LIBUNWIND_LIBRARY_VERSION "1.0" CACHE STRING
"Version of libunwind. This will be reflected in the name of the shared library produced.
For example, -DLIBUNWIND_LIBRARY_VERSION=x.y will result in the library being named
libunwind.x.y.dylib, along with the usual symlinks pointing to that. On Apple platforms,
this also controls the linker's 'current_version' property.")

if(MINGW)
set(LIBUNWIND_DEFAULT_TEST_CONFIG "llvm-libunwind-mingw.cfg.in")
elseif (LIBUNWIND_ENABLE_SHARED)
Expand Down
13 changes: 2 additions & 11 deletions libunwind/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ if (LIBUNWIND_ENABLE_SHARED AND
"on C++ ABI library is not supported.")
endif()

if (APPLE)
add_compile_flags("-U__STRICT_ANSI__")
add_link_flags("-compatibility_version 1" "-install_name /usr/lib/libunwind.1.dylib")

if (CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6")
add_link_flags("-current_version ${LIBUNWIND_VERSION}" "/usr/lib/libSystem.B.dylib")
endif ()
endif ()

if (HAIKU)
add_library_flags_if(LIBUNWIND_HAS_ROOT_LIB root)

Expand Down Expand Up @@ -170,8 +161,8 @@ if (LIBUNWIND_ENABLE_SHARED)
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
LINKER_LANGUAGE C
OUTPUT_NAME "${LIBUNWIND_SHARED_OUTPUT_NAME}"
VERSION "1.0"
SOVERSION "1"
VERSION "${LIBUNWIND_LIBRARY_VERSION}"
SOVERSION "1"
)

list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared")
Expand Down
Loading