llvm.org GIT mirror llvm / 2be8ab4
Enable building LTO on WIN32. Enable building the LTO library (.lib and.dll) and llvm-lto.exe on Windows with MSVC and Mingw as well as re-enabling the associated test. Patch by Greg Bedwell! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191823 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
4 changed file(s) with 19 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1616 call void @PR14512()
1717 ret i32 0
1818 }
19 ; XFAIL: win32
11 if not 'X86' in targets:
22 config.unsupported = True
33
4 if config.root.host_os in ['Cygwin', 'MingW', 'Windows']:
4 if config.root.host_os in ['Cygwin']:
55 config.unsupported = True
4242 add_llvm_tool_subdirectory(obj2yaml)
4343 add_llvm_tool_subdirectory(yaml2obj)
4444
45 if( NOT WIN32 )
45 if( NOT CYGWIN )
4646 add_llvm_tool_subdirectory(lto)
4747 add_llvm_tool_subdirectory(llvm-lto)
4848 else()
88 lto.cpp
99 )
1010
11 if( NOT WIN32 AND LLVM_ENABLE_PIC )
11 if( NOT CYGWIN AND LLVM_ENABLE_PIC )
12 if ( WIN32 )
13 # Create .def file containing a list of exports preceeded by
14 # 'EXPORTS'. The file "lto.exports" already contains the list, so we
15 # massage it into the correct format here to create "lto.exports.def".
16 set(LTO_EXPORTS_DEF ${CMAKE_CURRENT_BINARY_DIR}/lto.exports.def)
17 file(READ "lto.exports" exports_list)
18 file(WRITE ${LTO_EXPORTS_DEF} "LIBRARY LTO\n")
19 file(APPEND ${LTO_EXPORTS_DEF} "EXPORTS\n")
20 file(APPEND ${LTO_EXPORTS_DEF} ${exports_list})
21 set(SHARED_LIB_SOURCES ${SOURCES} ${LTO_EXPORTS_DEF})
22 else()
23 set(SHARED_LIB_SOURCES ${SOURCES})
24 endif()
25
1226 set(bsl ${BUILD_SHARED_LIBS})
1327 set(BUILD_SHARED_LIBS ON)
14 add_llvm_library(LTO ${SOURCES})
28 add_llvm_library(LTO ${SHARED_LIB_SOURCES})
1529 set_property(TARGET LTO PROPERTY OUTPUT_NAME "LTO")
1630 set(BUILD_SHARED_LIBS ${bsl})
1731 set(LTO_STATIC_TARGET_NAME LTO_static)
2438 set_property(TARGET ${LTO_STATIC_TARGET_NAME} PROPERTY OUTPUT_NAME "LTO")
2539 endif()
2640
27 if( NOT WIN32 )
41 if( NOT CYGWIN )
2842 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
2943 DESTINATION include/llvm-c)
3044 endif()