llvm.org GIT mirror llvm / 44a62ba
[CMake] libLTO: Use (SHARED|STATIC) to build both shared LTO and LTO_static. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201856 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 5 years ago
1 changed file(s) with 3 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
1515
1616 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
1717
18 if( NOT CYGWIN AND LLVM_ENABLE_PIC )
19 set(SHARED_LIB_SOURCES ${SOURCES})
20
21 set(bsl ${BUILD_SHARED_LIBS})
22 set(BUILD_SHARED_LIBS ON)
23 add_llvm_library(LTO ${SHARED_LIB_SOURCES})
24 set_property(TARGET LTO PROPERTY OUTPUT_NAME "LTO")
25 set(BUILD_SHARED_LIBS ${bsl})
26 set(LTO_STATIC_TARGET_NAME LTO_static)
27 else()
28 set(LTO_STATIC_TARGET_NAME LTO)
18 if(NOT CYGWIN AND LLVM_ENABLE_PIC)
19 set(ENABLE_SHARED SHARED)
2920 endif()
3021
31 if( NOT BUILD_SHARED_LIBS )
32 add_llvm_library(${LTO_STATIC_TARGET_NAME} ${SOURCES})
33 set_property(TARGET ${LTO_STATIC_TARGET_NAME} PROPERTY OUTPUT_NAME "LTO")
34 endif()
22 add_llvm_library(LTO ${ENABLE_SHARED} STATIC ${SOURCES})
3523
3624 if( NOT CYGWIN )
3725 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h