Build LTO as a static library too.
authorOscar Fuentes <ofv@wanadoo.es>
Sat, 12 Mar 2011 17:32:30 +0000 (17:32 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Sat, 12 Mar 2011 17:32:30 +0000 (17:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127549 91177308-0d34-0410-b5e6-96231b3b80d8

tools/CMakeLists.txt
tools/lto/CMakeLists.txt

index 72364618b36dcd3d4b7f85c038272f72776f7fa4..4d9e32db8e89d8c9dcae397c12f7e7cc3bf8e588 100644 (file)
@@ -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()
index b0aebd4f2ee1807a6471c49e9927e4bb9fa30c51..ece4af3263ed46b08270c2c03c8ed9fb320d5976 100644 (file)
@@ -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()