Silence -Wunused-variable in release builds.
[llvm/stm8.git] / tools / lto / CMakeLists.txt
blob7e2c5f06e61f5ce47a2c94e249de63564c9fb720
1 set(LLVM_LINK_COMPONENTS
2   ${LLVM_TARGETS_TO_BUILD}
3   ipo scalaropts linker bitreader bitwriter mcdisassembler)
5 add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" )
7 set(SOURCES
8   LTOCodeGenerator.cpp
9   lto.cpp
10   LTOModule.cpp
11   )
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()
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()