# HG changeset patch # User Alain Mazy # Date 1764267009 -3600 # Node ID 6dbef9ad4f20603f0a0027e01fdc0bbb7df17f65 # Parent 98344e40904adb75246feb1e255ca73c670d3396 trying to improve AppleClang builds diff -r 98344e40904a -r 6dbef9ad4f20 OrthancFramework/Resources/CMake/Compiler.cmake --- a/OrthancFramework/Resources/CMake/Compiler.cmake Wed Nov 26 16:41:42 2025 +0100 +++ b/OrthancFramework/Resources/CMake/Compiler.cmake Thu Nov 27 19:10:09 2025 +0100 @@ -21,6 +21,8 @@ # This file sets all the compiler-related flags +message(STATUS "CMAKE_CXX_COMPILER_ID is ${CMAKE_CXX_COMPILER_ID}") +message(STATUS "CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}") if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") # Since Orthanc 1.12.7 that allows CMake 4.0, builds for macOS @@ -249,6 +251,10 @@ # it seems that some recent MacOS compilers don't set these flags correctly which prevents zlib from building correctly SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64") + if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSTRERROR_R_INT=1 -D_POSIX_C_SOURCE=200112L") + endif() + add_definitions( -D_XOPEN_SOURCE=1 )