summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2011-03-12 17:32:30 +0000
committerOscar Fuentes <ofv@wanadoo.es>2011-03-12 17:32:30 +0000
commit68c1f55fdcf81e48b14878eb58d41667ff9c2e74 (patch)
tree07f34926dc59f8acad725aebdd2c602bb0dc3de6
parent5acc751b6f8679473edbf4f3b8165986eba9b0f8 (diff)
downloadbcm5719-llvm-68c1f55fdcf81e48b14878eb58d41667ff9c2e74.tar.gz
bcm5719-llvm-68c1f55fdcf81e48b14878eb58d41667ff9c2e74.zip
Build LTO as a static library too.
llvm-svn: 127549
-rw-r--r--llvm/tools/CMakeLists.txt2
-rw-r--r--llvm/tools/lto/CMakeLists.txt12
2 files changed, 9 insertions, 5 deletions
diff --git a/llvm/tools/CMakeLists.txt b/llvm/tools/CMakeLists.txt
index 72364618b36..4d9e32db8e8 100644
--- a/llvm/tools/CMakeLists.txt
+++ b/llvm/tools/CMakeLists.txt
@@ -46,10 +46,10 @@ add_subdirectory(llvm-stub)
add_subdirectory(edis)
add_subdirectory(llvmc)
+add_subdirectory(lto)
if( LLVM_ENABLE_PIC )
# TODO: support other systems:
if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
- add_subdirectory(lto)
add_subdirectory(gold)
endif()
endif()
diff --git a/llvm/tools/lto/CMakeLists.txt b/llvm/tools/lto/CMakeLists.txt
index b0aebd4f2ee..ece4af3263e 100644
--- a/llvm/tools/lto/CMakeLists.txt
+++ b/llvm/tools/lto/CMakeLists.txt
@@ -4,12 +4,16 @@ set(LLVM_LINK_COMPONENTS
add_definitions( -DLLVM_VERSION_INFO=\"${PACKAGE_VERSION}\" )
-# TODO: build a static library too.
-set(BUILD_SHARED_LIBS ON)
-
-add_llvm_library(LTO
+set(SOURCES
LTOCodeGenerator.cpp
lto.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()
OpenPOWER on IntegriCloud