summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMarkus Minichmayr <markus@tapkey.com>2022-03-06 22:32:25 +0100
committerAllen Winter <allen.winter@kdab.com>2022-06-03 11:17:08 -0400
commit0d932910200e77b884d89917545495215567a9f6 (patch)
tree3c95f72bd3424e756964781db9e2c568a8d8426e /CMakeLists.txt
parent19ca5336c707bb70b3c62805c04fe04e35941d68 (diff)
downloadlibical-git-0d932910200e77b884d89917545495215567a9f6.tar.gz
Introduce `USE_64BIT_ICALTIME_T` CMake option to allow redirecting icaltime_t to 64-bit types.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 17 insertions, 1 deletions
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