cmake: Reflect minor version change in SONAME for C++ and C# (#25617)

* cmake: Use major.minor for the SONAME for C++ and C#

This helps to localize the ABI changes between versions and makes
possible to install different versions of GRPC side-by-side on the same
root filesystem. This is still not an ideal solution, but at least the
expectation would be whenever the core version has changed, the SONAME
would be different for any other related artifacts.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>

* doc: Add section about ABI compat to BUILDING.md

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
pull/25415/head
Anatol Belski 4 years ago committed by GitHub
parent a622fe2c97
commit df73c74f99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      BUILDING.md
  2. 4
      CMakeLists.txt
  3. 4
      templates/CMakeLists.txt.template

@ -245,6 +245,12 @@ $ make
[Cross-compile example](test/distrib/cpp/run_distrib_test_cmake_aarch64_cross.sh)
### A note on SONAME and its ABI compatibility implications in the cmake build
Best efforts are made to bump the SONAME revision during ABI breaches. While a
change in the SONAME clearly indicates an ABI incompatibility, no hard guarantees
can be made about any sort of ABI stability across the same SONAME version.
## Building with make on UNIX systems (deprecated)
NOTE: `make` used to be gRPC's default build system, but we're no longer recommending it. You should use `bazel` or `cmake` instead. The `Makefile` is only intended for internal usage and is not meant for public consumption.

@ -29,9 +29,9 @@ set(PACKAGE_VERSION "1.37.0-dev")
set(gRPC_CORE_VERSION "15.0.0")
set(gRPC_CORE_SOVERSION "15")
set(gRPC_CPP_VERSION "1.37.0-dev")
set(gRPC_CPP_SOVERSION "1")
set(gRPC_CPP_SOVERSION "1.37")
set(gRPC_CSHARP_VERSION "2.37.0-dev")
set(gRPC_CSHARP_SOVERSION "2")
set(gRPC_CSHARP_SOVERSION "2.37")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME "${PACKAGE_NAME}-${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")

@ -145,9 +145,9 @@
set(gRPC_CORE_VERSION "${settings.core_version}")
set(gRPC_CORE_SOVERSION "${settings.core_version.major}")
set(gRPC_CPP_VERSION "${settings.cpp_version}")
set(gRPC_CPP_SOVERSION "${settings.cpp_version.major}")
set(gRPC_CPP_SOVERSION "${settings.cpp_version.major}.${settings.cpp_version.minor}")
set(gRPC_CSHARP_VERSION "${settings.csharp_version}")
set(gRPC_CSHARP_SOVERSION "${settings.csharp_version.major}")
set(gRPC_CSHARP_SOVERSION "${settings.csharp_version.major}.${settings.csharp_version.minor}")
set(PACKAGE_STRING "<%text>${PACKAGE_NAME} ${PACKAGE_VERSION}</%text>")
set(PACKAGE_TARNAME "<%text>${PACKAGE_NAME}-${PACKAGE_VERSION}</%text>")
set(PACKAGE_BUGREPORT "https://github.com/grpc/grpc/issues/")

Loading…
Cancel
Save