• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1set(LLVM_LINK_COMPONENTS
2  ${LLVM_TARGETS_TO_BUILD}
3  BitReader
4  Core
5  LTO
6  MC
7  MCDisassembler
8  Support
9  Target
10  )
11
12set(SOURCES
13  LTODisassembler.cpp
14  lto.cpp
15  )
16
17set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
18
19add_llvm_library(LTO SHARED ${SOURCES})
20
21install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
22  DESTINATION include/llvm-c
23  COMPONENT LTO)
24
25if (APPLE)
26  set(LTO_VERSION ${LLVM_VERSION_MAJOR})
27  if(LLVM_LTO_VERSION_OFFSET)
28    math(EXPR LTO_VERSION "${LLVM_VERSION_MAJOR} + ${LLVM_LTO_VERSION_OFFSET}")
29  endif()
30  set_property(TARGET LTO APPEND_STRING PROPERTY
31              LINK_FLAGS
32              " -compatibility_version 1 -current_version ${LTO_VERSION}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
33endif()
34