forked from OSchip/llvm-project
[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:
parent
20b641be2b
commit
e978cdc84b
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue