Skip to content

Commit 76f37d4

Browse files
[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
1 parent fa7145d commit 76f37d4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llvm/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ if (NOT PACKAGE_VERSION)
2828
"${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}")
2929
endif()
3030

31+
if(NOT DEFINED LLVM_SHLIB_SYMBOL_VERSION)
32+
# "Symbol version prefix for libLLVM.so"
33+
set(LLVM_SHLIB_SYMBOL_VERSION "LLVM_${LLVM_VERSION_MAJOR}")
34+
endif()
35+
3136
if ((CMAKE_GENERATOR MATCHES "Visual Studio") AND (MSVC_TOOLSET_VERSION LESS 142) AND (CMAKE_GENERATOR_TOOLSET STREQUAL ""))
3237
message(WARNING "Visual Studio generators use the x86 host compiler by "
3338
"default, even for 64-bit targets. This can result in linker "
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
LLVM_@LLVM_VERSION_MAJOR@ { global: *; };
1+
@LLVM_SHLIB_SYMBOL_VERSION@ { global: *; };

0 commit comments

Comments
 (0)