llvm.org GIT mirror llvm / a5b9cd1
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@191670 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 7 years ago
4 changed file(s) with 16 addition(s) and 5 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(SOURCES ${SOURCES} ${LTO_EXPORTS_DEF})
22 endif()
23
1224 set(bsl ${BUILD_SHARED_LIBS})
1325 set(BUILD_SHARED_LIBS ON)
1426 add_llvm_library(LTO ${SOURCES})
2436 set_property(TARGET ${LTO_STATIC_TARGET_NAME} PROPERTY OUTPUT_NAME "LTO")
2537 endif()
2638
27 if( NOT WIN32 )
39 if( NOT CYGWIN )
2840 install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/lto.h
2941 DESTINATION include/llvm-c)
3042 endif()