From 43fd04ce411ae8a5894863e867056d8756e78701 Mon Sep 17 00:00:00 2001 From: mjk Date: Sun, 16 Jan 2022 13:47:30 +0000 Subject: [PATCH] define _POSIX_C_SOURCE=1 on windows Fixes "undefined reference to `localtime_r`" in, e.g., Vala's GLib.Time.local when building on mingw-w64. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74043f08..f9191207 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,6 +179,7 @@ if (NOT NO_DEBUG) endif (NOT NO_DEBUG) if (WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=1") set(CMAKE_VALA_FLAGS "${CMAKE_VALA_FLAGS} --define=_WIN32") endif(WIN32)