From 0d932910200e77b884d89917545495215567a9f6 Mon Sep 17 00:00:00 2001 From: Markus Minichmayr Date: Sun, 6 Mar 2022 22:32:25 +0100 Subject: Introduce `USE_64BIT_ICALTIME_T` CMake option to allow redirecting icaltime_t to 64-bit types. --- CMakeLists.txt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 062f3de8..5a8ae773 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,10 @@ # Set to build using a 32bit time_t (ignored unless building with MSVC on Windows) # Default=false (use the default size of time_t) # +# -DUSE_64BIT_ICALTIME_T=[true|false] +# Experimental: Redirect icaltime_t (and related functions) to a 64-bit version of time_t rather than to time_t. +# Default=false (use plain time_t) +# # -DLIBICAL_BUILD_TESTING=[true|false] # Set to build the test suite # Default=true @@ -325,6 +329,19 @@ if(WIN32) add_definitions(-DBIG_ENDIAN=0 -DLITTLE_ENDIAN=1 -DBYTE_ORDER=BIG_ENDIAN) endif() +# define icaltime_t +libical_option(USE_64BIT_ICALTIME_T "Experimental: Redirect icaltime_t (and related functions) to a 64-bit version of time_t rather than to time_t." False) +if(USE_64BIT_ICALTIME_T) + if(MSVC) + set(ICAL_ICALTIME_T_TYPE "__time64_t") + else() + message(FATAL_ERROR + "Option USE_64BIT_ICALTIME_T is not supported with this compiler or architecture.") + endif() +else() + set(ICAL_ICALTIME_T_TYPE "time_t") +endif() + # Use GNUInstallDirs include(GNUInstallDirs) @@ -392,7 +409,6 @@ endif() include(ConfigureChecks.cmake) add_definitions(-DHAVE_CONFIG_H) -configure_file(config_public.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_public.h) configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) set(INSTALL_TARGETS_DEFAULT_ARGS -- cgit v1.2.1