Skip to content

Commit

Permalink
[libc++] Introduce LIBCXX_LIBRARY_VERSION
Browse files Browse the repository at this point in the history
This allows controlling the current_version linker property on Apple
platforms.

Differential Revision: https://reviews.llvm.org/D125686
  • Loading branch information
ldionne committed May 17, 2022
1 parent df2a4ea commit 6de59ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion libcxx/CMakeLists.txt
Expand Up @@ -177,7 +177,14 @@ if (LIBCXX_ABI_UNSTABLE)
else()
set(abi_version "1")
endif()
set(LIBCXX_ABI_VERSION "${abi_version}" CACHE STRING "ABI version of libc++. Can be either 1 or 2, where 2 is currently the unstable ABI. Defaults to 1 unless LIBCXX_ABI_UNSTABLE is specified, in which case this is 2.")
set(LIBCXX_ABI_VERSION "${abi_version}" CACHE STRING
"ABI version of libc++. Can be either 1 or 2, where 2 is currently the unstable ABI.
Defaults to 1 unless LIBCXX_ABI_UNSTABLE is specified, in which case this is 2.")
set(LIBCXX_LIBRARY_VERSION "${LIBCXX_ABI_VERSION}.0" CACHE STRING
"Version of libc++. This will be reflected in the name of the shared library produced.
For example, -DLIBCXX_LIBRARY_VERSION=x.y will result in the library being named
libc++.x.y.dylib, along with the usual symlinks pointing to that. On Apple platforms,
this also controls the linker's 'current_version' property.")
set(LIBCXX_ABI_NAMESPACE "__${LIBCXX_ABI_VERSION}" CACHE STRING "The inline ABI namespace used by libc++. It defaults to __n where `n` is the current ABI version.")
if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*")
message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE must be a reserved identifier.")
Expand Down
2 changes: 1 addition & 1 deletion libcxx/src/CMakeLists.txt
Expand Up @@ -211,7 +211,7 @@ if (LIBCXX_ENABLE_SHARED)
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
OUTPUT_NAME "c++"
VERSION "${LIBCXX_ABI_VERSION}.0"
VERSION "${LIBCXX_LIBRARY_VERSION}"
SOVERSION "${LIBCXX_ABI_VERSION}"
DEFINE_SYMBOL ""
)
Expand Down

0 comments on commit 6de59ca

Please sign in to comment.