[PATCH] D14040: [CMake] make name of libLLVM configurable

Andrew Wilkins via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 24 00:23:39 PDT 2015


axw created this revision.
axw added reviewers: beanz, chapuni, tstellarAMD, sylvestre.ledru.
axw added a subscriber: llvm-commits.

Make the name and SONAME of the monolithic libLLVM
configurable. This enables creation of libraries
with consistent names between old autotools-based
builds, and new CMake builds. This diff does not
change the current naming scheme, but it would be
trivial to do so later.

This is in response to
https://llvm.org/bugs/show_bug.cgi?id=25059, and
also to enable Debian's LLVM packaging to move to
CMake.

llvm_add_library now has SOVERSION and VERSION
options, which, if non-empty and not equal to ".",
will be set as properties on shared library targets.
The "." special case is due to empty string arguments
not resulting in variables defined. This allows us
to have:
 (a) defaults if SOVERSION/VERSION are unspecified
     (i.e. existing MAJOR.MINOR for SOVERSION, etc.)
 (b) a means of using the CMake-default SOVERSION/VERSION
     (i.e. by passing ".")

There are three new user-configurable options:
  LLVM_DYLIB_NAME (defaults to "LLVM")
  LLVM_DYLIB_SOVERSION (defaults to $MAJOR.$MINOR)
  LLVM_DYLIB_VERSION (defaults to $PACKAGE_VERSION)

In order to have the library name, say, libLLVM-3.8.so,
with a matching SONAME, you would set:
    LLVM_DYLIB_NAME=LLVM-3.8
    LLVM_DYLIB_SOVERSION=.
    LLVM_DYLIB_VERSION=.

http://reviews.llvm.org/D14040

Files:
  CMakeLists.txt
  cmake/modules/AddLLVM.cmake
  cmake/modules/LLVM-Config.cmake
  tools/llvm-go/llvm-go.go
  tools/llvm-shlib/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14040.38295.patch
Type: text/x-patch
Size: 7809 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151024/01a2ee27/attachment.bin>


More information about the llvm-commits mailing list