aboutsummaryrefslogtreecommitdiff
path: root/tools/lto/CMakeLists.txt
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
commit54efb7371a8a0e78cd97a32e4b59a9d82c521329 (patch)
tree7dc62e675bfdc31d4e59319ab421c11929567a3e /tools/lto/CMakeLists.txt
parent14b2a59301e9e4065c7b9b07a0c68462b6037a4f (diff)
Build LTO as a static library too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto/CMakeLists.txt')
-rw-r--r--tools/lto/CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt
index b0aebd4f2e..ece4af3263 100644
--- a/tools/lto/CMakeLists.txt
+++ b/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()