911297609b0c26e3834c0704b7e0e73994a8409c
[oota-llvm.git] / tools / lto / CMakeLists.txt
1 set(LLVM_LINK_COMPONENTS
2   ${LLVM_TARGETS_TO_BUILD}
3   ipo scalaropts linker bitreader bitwriter mcdisassembler vectorize)
4
5 add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" )
6
7 set(SOURCES
8   LTOCodeGenerator.cpp
9   lto.cpp
10   LTOModule.cpp
11   )
12
13 if( NOT WIN32 AND LLVM_ENABLE_PIC )
14   set(bsl ${BUILD_SHARED_LIBS})
15   set(BUILD_SHARED_LIBS ON)
16   add_llvm_library(LTO ${SOURCES})
17   set_property(TARGET LTO PROPERTY OUTPUT_NAME "LTO")
18   set(BUILD_SHARED_LIBS ${bsl})
19   set(LTO_STATIC_TARGET_NAME LTO_static)
20 else()
21   set(LTO_STATIC_TARGET_NAME LTO)
22 endif()
23
24 if( NOT BUILD_SHARED_LIBS )
25   add_llvm_library(${LTO_STATIC_TARGET_NAME} ${SOURCES})
26   set_property(TARGET ${LTO_STATIC_TARGET_NAME} PROPERTY OUTPUT_NAME "LTO")
27 endif()