# HG changeset patch # User Sebastien Jodogne # Date 1432893014 -7200 # Node ID 601d34afdab974edf4f73e63ae4f91b38da45c81 # Parent 65a000d823c47d098c64b20b61087c968239de6d patch for recent versions of MinGW diff -r 65a000d823c4 -r 601d34afdab9 Resources/CMake/Compiler.cmake --- a/Resources/CMake/Compiler.cmake Thu May 28 16:48:36 2015 +0200 +++ b/Resources/CMake/Compiler.cmake Fri May 29 11:50:14 2015 +0200 @@ -70,6 +70,10 @@ if (${CMAKE_COMPILER_IS_GNUCXX}) # This is a patch for MinGW64 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++") + + # This line is necessary to compile with recent versions of MinGW, + # otherwise "libwinpthread-1.dll" is not statically linked. + SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic") endif() elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") diff -r 65a000d823c4 -r 601d34afdab9 Resources/CMake/DcmtkConfiguration.cmake --- a/Resources/CMake/DcmtkConfiguration.cmake Thu May 28 16:48:36 2015 +0200 +++ b/Resources/CMake/DcmtkConfiguration.cmake Fri May 29 11:50:14 2015 +0200 @@ -118,6 +118,12 @@ ) endif() + # This patch improves speed, even for Windows + execute_process( + COMMAND patch -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/dcmtk-linux-speed.patch + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + ) + endif() list(REMOVE_ITEM DCMTK_SOURCES diff -r 65a000d823c4 -r 601d34afdab9 Resources/CMake/GoogleLogConfiguration.cmake --- a/Resources/CMake/GoogleLogConfiguration.cmake Thu May 28 16:48:36 2015 +0200 +++ b/Resources/CMake/GoogleLogConfiguration.cmake Fri May 29 11:50:14 2015 +0200 @@ -76,8 +76,10 @@ ) endif() + # Patches for MinGW execute_process( - COMMAND patch -N port.h ${ORTHANC_ROOT}/Resources/Patches/glog-port-h.diff + #COMMAND patch -N port.h ${ORTHANC_ROOT}/Resources/Patches/glog-port-h.diff + COMMAND patch -N port.h ${ORTHANC_ROOT}/Resources/Patches/glog-port-h-v2.diff WORKING_DIRECTORY ${GOOGLE_LOG_SOURCES_DIR}/src/windows ) execute_process( diff -r 65a000d823c4 -r 601d34afdab9 Resources/EmbedResources.py --- a/Resources/EmbedResources.py Thu May 28 16:48:36 2015 +0200 +++ b/Resources/EmbedResources.py Fri May 29 11:50:14 2015 +0200 @@ -229,6 +229,10 @@ cpp.write("0x%02x" % c) pos += 1 + # Zero-size array are disallowed, so we put one single void character in it. + if pos == 0: + cpp.write(' 0') + cpp.write(' };\n') cpp.write(' static const size_t resource%dSize = %d;\n' % (item['Index'], pos))