[llvm-commits] [llvm] r127549 - in /llvm/trunk/tools: CMakeLists.txt lto/CMakeLists.txt

Oscar Fuentes ofv at wanadoo.es
Sat Mar 12 09:32:30 PST 2011


Author: ofv
Date: Sat Mar 12 11:32:30 2011
New Revision: 127549

URL: http://llvm.org/viewvc/llvm-project?rev=127549&view=rev
Log:
Build LTO as a static library too.

Modified:
    llvm/trunk/tools/CMakeLists.txt
    llvm/trunk/tools/lto/CMakeLists.txt

Modified: llvm/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/CMakeLists.txt?rev=127549&r1=127548&r2=127549&view=diff
==============================================================================
--- llvm/trunk/tools/CMakeLists.txt (original)
+++ llvm/trunk/tools/CMakeLists.txt Sat Mar 12 11:32:30 2011
@@ -46,10 +46,10 @@
 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()

Modified: llvm/trunk/tools/lto/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/CMakeLists.txt?rev=127549&r1=127548&r2=127549&view=diff
==============================================================================
--- llvm/trunk/tools/lto/CMakeLists.txt (original)
+++ llvm/trunk/tools/lto/CMakeLists.txt Sat Mar 12 11:32:30 2011
@@ -4,12 +4,16 @@
 
 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()





More information about the llvm-commits mailing list