[PATCH] D39939: [cmake] Allow appending a free-form suffix to SOVERSION
Michał Górny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 11 04:54:07 PST 2017
mgorny created this revision.
Add a new LLVM_SOVERSION_SUFFIX option that could be used to append
a free-form suffix to the SOVERSION used for shared libraries built
via BUILD_SHARED_LIBS.
We are planning to use this to temporarily preserve ABI-incompatible
variants of LLVM while switching the system between them, e.g. when
rebuilding the system to use libc++. Normally this would mean that once
LLVM is rebuilt using libc++ all the reverse dependencies become
immediately broken. Using a distinct SOVERSION allows us to preserve
the ABI compatibility before all the packages are rebuilt.
Repository:
rL LLVM
https://reviews.llvm.org/D39939
Files:
CMakeLists.txt
cmake/modules/AddLLVM.cmake
cmake/modules/LLVMConfig.cmake.in
Index: cmake/modules/LLVMConfig.cmake.in
===================================================================
--- cmake/modules/LLVMConfig.cmake.in
+++ cmake/modules/LLVMConfig.cmake.in
@@ -57,6 +57,7 @@
set(LLVM_ON_WIN32 @LLVM_ON_WIN32@)
set(LLVM_LIBDIR_SUFFIX @LLVM_LIBDIR_SUFFIX@)
+set(LLVM_SOVERSION_SUFFIX @LLVM_SOVERSION_SUFFIX@)
set(LLVM_INCLUDE_DIRS "@LLVM_CONFIG_INCLUDE_DIRS@")
set(LLVM_LIBRARY_DIRS "@LLVM_CONFIG_LIBRARY_DIRS@")
Index: cmake/modules/AddLLVM.cmake
===================================================================
--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -479,8 +479,8 @@
set_target_properties(${name}
PROPERTIES
# Since 4.0.0, the ABI version is indicated by the major version
- SOVERSION ${LLVM_VERSION_MAJOR}
- VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
+ SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_SOVERSION_SUFFIX}
+ VERSION ${LLVM_VERSION_MAJOR}${LLVM_SOVERSION_SUFFIX}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX})
endif()
endif()
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -283,6 +283,10 @@
"Path to install LLVM utilities (enabled by LLVM_INSTALL_UTILS=ON) (defaults to LLVM_TOOLS_INSTALL_DIR)")
mark_as_advanced(LLVM_TOOLS_INSTALL_DIR)
+set(LLVM_SOVERSION_SUFFIX "" CACHE STRING
+ "Additional suffix appended to SONAME of LLVM libraries")
+mark_as_advanced(LLVM_SOVERSION_SUFFIX)
+
# They are used as destination of target generators.
set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39939.122578.patch
Type: text/x-patch
Size: 1831 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171111/df34b610/attachment.bin>
More information about the llvm-commits
mailing list