diff --git a/third_party/curl/CMake/OtherTests.cmake b/third_party/curl/CMake/OtherTests.cmake index 7701c0e..7dc1c2f 100644 --- a/third_party/curl/CMake/OtherTests.cmake +++ b/third_party/curl/CMake/OtherTests.cmake @@ -72,6 +72,19 @@ check_c_source_compiles("${_source_epilogue} (void)ts; return 0; }" HAVE_STRUCT_TIMEVAL) +if (HAVE_SYS_TIME_H) +check_c_source_compiles("${_source_epilogue} + #include + int main(void) + { + struct timeval ts; + ts.tv_sec = 0; + ts.tv_usec = 0; + (void)ts; + return 0; + }" HAVE_STRUCT_TIMEVAL_BY_SYS_TIMEVAL) + set(HAVE_STRUCT_TIMEVAL ${HAVE_STRUCT_TIMEVAL_BY_SYS_TIMEVAL}) +endif() unset(CMAKE_TRY_COMPILE_TARGET_TYPE)