[llvm] r250245 - [CMake] Add compatibility and current versioning to libLTO to match autoconf support.
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 13 15:54:29 PDT 2015
Author: cbieneman
Date: Tue Oct 13 17:54:29 2015
New Revision: 250245
URL: http://llvm.org/viewvc/llvm-project?rev=250245&view=rev
Log:
[CMake] Add compatibility and current versioning to libLTO to match autoconf support.
This also adds LLVM_LTO_VERSION_OFFSET to support functional equivalence to autoconf.
Modified:
llvm/trunk/tools/lto/CMakeLists.txt
Modified: llvm/trunk/tools/lto/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/CMakeLists.txt?rev=250245&r1=250244&r2=250245&view=diff
==============================================================================
--- llvm/trunk/tools/lto/CMakeLists.txt (original)
+++ llvm/trunk/tools/lto/CMakeLists.txt Tue Oct 13 17:54:29 2015
@@ -19,3 +19,13 @@ add_llvm_library(LTO SHARED ${SOURCES})
install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
DESTINATION include/llvm-c)
+
+if (APPLE)
+ set(LTO_VERSION ${LLVM_VERSION_MAJOR})
+ if(LLVM_LTO_VERSION_OFFSET)
+ math(EXPR LTO_VERSION "${LLVM_VERSION_MAJOR} + ${LLVM_LTO_VERSION_OFFSET}")
+ endif()
+ set_property(TARGET LTO APPEND_STRING PROPERTY
+ LINK_FLAGS
+ " -compatibility_version 1 -current_version ${LTO_VERSION}.${LLVM_VERSION_MINOR}")
+endif()
More information about the llvm-commits
mailing list