set(LLVM_LINK_COMPONENTS
  ${LLVM_TARGETS_TO_BUILD}
  Core
  LTO
  MC
  MCDisassembler
  Support
  Target
  )

set(SOURCES
  LTODisassembler.cpp
  lto.cpp
  )

set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)

add_llvm_library(LTO SHARED ${SOURCES})

install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
  DESTINATION include/llvm-c)

set(LLVM_LINK_COMPONENTS
  ${LLVM_TARGETS_TO_BUILD}
  Core
  LTO
  MC
  MCDisassembler
  Support
  Target
  )

set(SOURCES
  LTODisassembler.cpp
  lto.cpp
  )

set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)

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

Add compatibility and current versioning to libLTO to match autoconf support.
[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: 0ff597fd157e6f4fc38580e8d64ab130330d2411@250245 91177308-0d34-0410-b5e6-96231b3b80d8
