[Github] Add LLVM Premerge Checks to the watchlist (#120230)
[llvm-project.git] / llvm / tools / lto / CMakeLists.txt
blob67f6d3af40e0551104795afb927c9651bada178d
1 set(LLVM_LINK_COMPONENTS
2   AllTargetsAsmParsers
3   AllTargetsCodeGens
4   AllTargetsDescs
5   AllTargetsDisassemblers
6   AllTargetsInfos
7   BitReader
8   Core
9   CodeGen
10   LTO
11   MC
12   MCDisassembler
13   Support
14   Target
15   )
17 set(SOURCES
18   LTODisassembler.cpp
19   lto.cpp
20   )
22 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
24 if(CMAKE_SYSTEM_NAME STREQUAL AIX)
25     set(LTO_LIBRARY_TYPE MODULE)
26     set(LTO_LIBRARY_NAME libLTO)
27   else()
28     set(LTO_LIBRARY_TYPE SHARED)
29     set(LTO_LIBRARY_NAME LTO)
30 endif()
32 add_llvm_library(${LTO_LIBRARY_NAME} ${LTO_LIBRARY_TYPE} INSTALL_WITH_TOOLCHAIN
33     ${SOURCES} DEPENDS intrinsics_gen)
35 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
36   DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/llvm-c"
37   COMPONENT LTO)
39 if (APPLE)
40   set(LTO_VERSION ${LLVM_VERSION_MAJOR})
41   if(LLVM_LTO_VERSION_OFFSET)
42     math(EXPR LTO_VERSION "${LLVM_VERSION_MAJOR} + ${LLVM_LTO_VERSION_OFFSET}")
43   endif()
44   set_property(TARGET LTO APPEND_STRING PROPERTY
45               LINK_FLAGS
46               " -compatibility_version 1 -current_version ${LTO_VERSION}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
47 endif()