Merge topic 'linux32-time64' into release-4.1

a760a74abf Tests: Optionally skip tests requiring 64-bit time_t
14e21fa992 bootstrap: Compile with 64-bit time_t on 32-bit Linux if possible

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10951
This commit is contained in:
Brad King
2025-07-21 14:02:05 +00:00
committed by Kitware Robot
3 changed files with 3 additions and 1 deletions

View File

@@ -747,6 +747,7 @@ add_RunCMake_test(set_property)
add_RunCMake_test(string
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR}
-DCMake_TEST_NO_64BIT_TIME=${CMake_TEST_NO_64BIT_TIME}
)
add_RunCMake_test(test_include_dirs)
add_RunCMake_test(BundleUtilities)

View File

@@ -23,6 +23,7 @@ run_cmake(JoinNoVar)
run_cmake(Timestamp)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX" # FIXME: Needs 64-bit build
AND NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS" # FIXME: Needs 64-bit build
AND NOT CMake_TEST_NO_64BIT_TIME
)
run_cmake(Timestamp2038)
endif()

View File

@@ -1848,7 +1848,7 @@ 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' ;;
*Linux*) system_flags='-D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64' ;;
esac
if test "x${system_flags}" != "x"; then
cmake_c_flags="${cmake_c_flags} ${system_flags}"