[cmake][NFC] Configuration for libLLVM.so symbol versioning

Symbol versioning can prevent unintented install-time conflicts
between different llvm versions.  Users may need to override this
for particular products (e.g. Julia), but this requires carrying
a source code patch.  This patch moves this ability to a
configuration option.  NFC for existing usage.

Differential Revision: https://reviews.llvm.org/D118672
This commit is contained in:
Stephen Neuendorffer 2022-01-31 17:56:42 -08:00
parent fa7145dfbf
commit 76f37d41b7
2 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,11 @@ if (NOT PACKAGE_VERSION)
"${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
endif()
if(NOT DEFINED LLVM_SHLIB_SYMBOL_VERSION)
# "Symbol version prefix for libLLVM.so"
set(LLVM_SHLIB_SYMBOL_VERSION "LLVM_${LLVM_VERSION_MAJOR}")
endif()
if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (MSVC_TOOLSET_VERSION LESS 142) AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
message(WARNING "Visual Studio generators use the x86 host compiler by "
"default, even for 64-bit targets. This can result in linker "

View File

@ -1 +1 @@
LLVM_@LLVM_VERSION_MAJOR@ { global: *; };
@LLVM_SHLIB_SYMBOL_VERSION@ { global: *; };