Don't force the build of toos/lto as a static lib.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 27 Jun 2014 02:51:21 +0000 (02:51 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 27 Jun 2014 02:51:21 +0000 (02:51 +0000)
Any uses of tools/lto as a static lib should probably move to lib/LTO.
This was also never implemented in the configure build, so this reduces
the differences among the two.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211852 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 13b7f5af85a7da7afc49a4fca3194a88ac30b420..846ad1e25d62ed7198128bb565f00c801ae952e1 100644 (file)
@@ -49,7 +49,7 @@ add_llvm_tool_subdirectory(llvm-c-test)
 add_llvm_tool_subdirectory(obj2yaml)
 add_llvm_tool_subdirectory(yaml2obj)
 
-if( NOT CYGWIN )
+if(NOT CYGWIN AND LLVM_ENABLE_PIC)
   add_llvm_tool_subdirectory(lto)
   add_llvm_tool_subdirectory(llvm-lto)
 else()
index 542053bf65245d6d01b32d4d65fb63332d4c8d9d..71391b7cf5f499d974ece0a18b2118e178a2e709 100644 (file)
@@ -16,11 +16,7 @@ set(SOURCES
 
 set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/lto.exports)
 
-if(NOT CYGWIN AND LLVM_ENABLE_PIC)
-  set(ENABLE_SHARED SHARED)
-endif()
-
-add_llvm_library(LTO ${ENABLE_SHARED} STATIC ${SOURCES})
+add_llvm_library(LTO SHARED ${SOURCES})
 
 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
   DESTINATION include/llvm-c)