From: Chris Bieneman Date: Tue, 13 Oct 2015 22:54:29 +0000 (+0000) Subject: [CMake] Add compatibility and current versioning to libLTO to match autoconf support. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=b5348ec6afd86543c9dfc11d910849921aa4cf10 [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250245 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt index c479fa954cb..e33ef8f37d8 100644 --- a/tools/lto/CMakeLists.txt +++ b/tools/lto/CMakeLists.txt @@ -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()