]> The Tcpdump Group git mirrors - tcpdump/commitdiff
CMake: Print the time_t size (32-bit/64-bit)
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 16 Mar 2025 20:25:45 +0000 (21:25 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Fri, 21 Mar 2025 14:08:16 +0000 (15:08 +0100)
(cherry picked from commit e80cc07aa0f7523c1aa94cea5f2c38c70c06b33f)

CMakeLists.txt

index 538e02f56a1989da264760ebc846585472f1cf91..0845c9abfbabbd8753e0e22acfbcb39d55fe0676 100644 (file)
@@ -443,11 +443,16 @@ include(CheckVariableExists)
 include(CheckTypeSize)
 
 #
-# Get the size of a time_t, to know whether it's 32-bit or 64-bit.
+# Get the size of a time_t, to know whether it's 32-bit or 64-bit. Print it.
 #
 cmake_push_check_state()
 set(CMAKE_EXTRA_INCLUDE_FILES time.h)
 check_type_size("time_t" SIZEOF_TIME_T)
+if(SIZEOF_TIME_T EQUAL 4)
+  message(STATUS "32-bit time_t")
+elseif(SIZEOF_TIME_T EQUAL 8)
+  message(STATUS "64-bit time_t")
+endif()
 cmake_pop_check_state()
 
 #