From 50d5887e65c370db03a4155e6eb78e2292ff52a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sat, 17 Apr 2021 17:32:24 +0200 Subject: [PATCH] localtime_r support on MinGW --- xmpsdk/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xmpsdk/CMakeLists.txt b/xmpsdk/CMakeLists.txt index a22698fb..92317a76 100644 --- a/xmpsdk/CMakeLists.txt +++ b/xmpsdk/CMakeLists.txt @@ -41,10 +41,16 @@ target_include_directories(exiv2-xmp # ("billion laughs attack"). # See https://bugzilla.redhat.com/show_bug.cgi?id=888769 target_compile_definitions(exiv2-xmp PRIVATE BanAllEntityUsage=1) + if (MSVC) target_compile_definitions(exiv2-xmp PRIVATE XML_STATIC) endif() +if (MINGW) + # https://stackoverflow.com/questions/18551409/localtime-r-support-on-mingw + target_compile_definitions(exiv2-xmp PRIVATE _POSIX_THREAD_SAFE_FUNCTIONS) +endif() + if (BUILD_SHARED_LIBS) set_property(TARGET exiv2-xmp PROPERTY POSITION_INDEPENDENT_CODE ON) endif()