152d45a
From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001
152d45a
From: Tom Stellard <tstellar@redhat.com>
152d45a
Date: Wed, 4 Aug 2021 14:05:38 -0700
152d45a
Subject: [PATCH] cmake: Allow shared libraries to customize the soname using
152d45a
 LLVM_ABI_REVISION
152d45a
152d45a
The LLVM_ABI_REVISION variable is intended to be used for release
152d45a
candidates which introduce an ABI change to a shared library.  This
152d45a
variable can be specified per library, so there is not one global value
152d45a
for all of LLVM.
152d45a
152d45a
For example, if we LLVM X.0.0-rc2 introduces an ABI change for a library
152d45a
compared with LLVM X.0.0-rc1, then the LLVM_ABI_REVISION number for
152d45a
library will be incremented by 1.
152d45a
152d45a
In the main branch, LLVM_ABI_REVISION should always be 0, it is only
152d45a
meant to be used in the release branch.
152d45a
152d45a
Differential Revision: https://reviews.llvm.org/D105594
152d45a
---
152d45a
 clang/tools/clang-shlib/CMakeLists.txt | 5 +++++
152d45a
 3 files changed, 19 insertions(+), 2 deletions(-)
152d45a
152d45a
diff --git a/clang/tools/clang-shlib/CMakeLists.txt b/clang/tools/clang-shlib/CMakeLists.txt
152d45a
index 9c1f8ea452b3..4d785924e4bb 100644
152d45a
--- a/clang/tools/clang-shlib/CMakeLists.txt
152d45a
+++ b/clang/tools/clang-shlib/CMakeLists.txt
152d45a
@@ -1,3 +1,8 @@
152d45a
+# In the main branch, LLVM_ABI_REVISION should always be 0.  In the release
152d45a
+# branches, this should be incremented before each release candidate every
152d45a
+# time the ABI of libclang-cpp.so changes.
152d45a
+set(LLVM_ABI_REVISION 0)
152d45a
+
152d45a
 # Building libclang-cpp.so fails if LLVM_ENABLE_PIC=Off
152d45a
 if (NOT LLVM_ENABLE_PIC)
152d45a
   return()
152d45a
-- 
152d45a
2.27.0
152d45a