diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 13b7f5af85a..846ad1e25d6 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -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() diff --git a/tools/lto/CMakeLists.txt b/tools/lto/CMakeLists.txt index 542053bf652..71391b7cf5f 100644 --- a/tools/lto/CMakeLists.txt +++ b/tools/lto/CMakeLists.txt @@ -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)