浏览代码

Merge topic 'bootstrap-_FILE_OFFSET_BITS-64' into release-3.21

a4b6743a3b bootstrap: Compile with _FILE_OFFSET_BITS=64 on Linux

Acked-by: Kitware Robot <[email protected]>
Merge-request: !6259
Brad King 4 年之前
父节点
当前提交
9a704fd37e
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      bootstrap

+ 10 - 0
bootstrap

@@ -1747,6 +1747,16 @@ if test "x${cmake_ansi_cxx_flags}" != "x"; then
   cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
 fi
 
+system_flags=''
+case "${cmake_system}" in
+  # Ensure filesystem access uses 64-bit offsets even on 32-bit hosts.
+  *Linux*) system_flags='-D_FILE_OFFSET_BITS=64' ;;
+esac
+if test "x${system_flags}" != "x"; then
+  cmake_c_flags="${cmake_c_flags} ${system_flags}"
+  cmake_cxx_flags="${cmake_cxx_flags} ${system_flags}"
+fi
+
 if test "x${cmake_c_flags}" != "x"; then
   cmake_c_flags="${cmake_c_flags} "
 fi