From: Francois-Xavier Le Bail Date: Sun, 16 Mar 2025 20:25:45 +0000 (+0100) Subject: CMake: Print the time_t size (32-bit/64-bit) X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/aefdf0987975cbfb0040328b8e26b216f65fcc6b CMake: Print the time_t size (32-bit/64-bit) (cherry picked from commit e80cc07aa0f7523c1aa94cea5f2c38c70c06b33f) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 538e02f5..0845c9ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() #