Build LTO as a static library too.

llvm-svn: 127549
This commit is contained in:
Oscar Fuentes 2011-03-12 17:32:30 +00:00
parent 5acc751b6f
commit 68c1f55fdc
2 changed files with 9 additions and 5 deletions

View File

@ -46,10 +46,10 @@ add_subdirectory(llvm-stub)
add_subdirectory(edis) add_subdirectory(edis)
add_subdirectory(llvmc) add_subdirectory(llvmc)
add_subdirectory(lto)
if( LLVM_ENABLE_PIC ) if( LLVM_ENABLE_PIC )
# TODO: support other systems: # TODO: support other systems:
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" ) if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
add_subdirectory(lto)
add_subdirectory(gold) add_subdirectory(gold)
endif() endif()
endif() endif()

View File

@ -4,12 +4,16 @@ set(LLVM_LINK_COMPONENTS
add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" ) add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" )
# TODO: build a static library too. set(SOURCES
set(BUILD_SHARED_LIBS ON)
add_llvm_library(LTO
LTOCodeGenerator.cpp LTOCodeGenerator.cpp
lto.cpp lto.cpp
LTOModule.cpp LTOModule.cpp
) )
add_llvm_library(LTO ${SOURCES})
if( NOT WIN32 AND LLVM_ENABLE_PIC )
set(BUILD_SHARED_LIBS ON)
add_llvm_library(LTO_dll ${SOURCES})
set_property(TARGET LTO_dll PROPERTY OUTPUT_NAME "LTO")
endif()