OSDN Git Service

[MinGW] Enable large file for mingw-w64
authorMartin Storsjo <martin@martin.st>
Wed, 24 Oct 2018 12:22:12 +0000 (12:22 +0000)
committerMartin Storsjo <martin@martin.st>
Wed, 24 Oct 2018 12:22:12 +0000 (12:22 +0000)
64-bit mingw doesn't define _FILE_OFFSET_BITS=64 by default.

Differential Revision: https://reviews.llvm.org/D53569

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

cmake/modules/HandleLLVMOptions.cmake

index 2787578..05db1b0 100644 (file)
@@ -224,6 +224,10 @@ if(NOT WIN32 AND NOT CYGWIN)
   append_if(SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG "-fvisibility-inlines-hidden" CMAKE_CXX_FLAGS)
 endif()
 
+if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MINGW)
+  add_definitions( -D_FILE_OFFSET_BITS=64 )
+endif()
+
 if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )
   # TODO: support other platforms and toolchains.
   if( LLVM_BUILD_32_BITS )