Skip to content

Commit

Permalink
[clang] Do not override libclang.so's SOVERSION if CLANG_FORCE_MATCHI…
Browse files Browse the repository at this point in the history
…NG_LIBCLANG_SOVERSION

Instead of setting libclang.so's SOVERSION to CLANG_MAJOR_VERSION
when CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION is enabled, do not override
it and let LLVM set the correct SOVERSION.  This fixes libclang.so
missing LLVM_VERSION_SUFFIX, and harmonizes the SOVERSION with other
shared libraries.

Differential Revision: https://reviews.llvm.org/D135701
  • Loading branch information
mgorny committed Oct 12, 2022
1 parent ec1a419 commit d3ce133
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions clang/tools/libclang/CMakeLists.txt
Expand Up @@ -9,10 +9,9 @@
# TODO: This should probably not be a option going forward but we
# we should commit to a way to do it. But due to getting this out
# in LLVM 15.x we opted for a option.
set(LIBCLANG_SOVERSION_ARG)
if(NOT CLANG_FORCE_MATCHING_LIBCLANG_SOVERSION)
set(LIBCLANG_SOVERSION 13)
else()
set(LIBCLANG_SOVERSION ${CLANG_VERSION_MAJOR})
set(LIBCLANG_SOVERSION_ARG SOVERSION 13)
endif()

# TODO: harmonize usage of LIBCLANG_SOVERSION / LIBCLANG_LIBARY_VERSION
Expand Down Expand Up @@ -195,7 +194,7 @@ if(ENABLE_SHARED)

set_target_properties(libclang PROPERTIES
VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}
SOVERSION ${LIBCLANG_SOVERSION})
${LIBCLANG_SOVERSION_ARG})
endif()
endif()

Expand Down

0 comments on commit d3ce133

Please sign in to comment.