1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[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.

llvm-svn: 250245
This commit is contained in:
Chris Bieneman 2015-10-13 22:54:29 +00:00
parent a190c153d6
commit 4b5a0d9544

View File

@ -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()