# HG changeset patch # User Alain Mazy # Date 1756991134 -7200 # Node ID 7a70d71a69bc053f0f7d86b578b678bb38857292 # Parent 0f7a1d78bc412118338152357bda1b4c5457dacb try to fix mingw build diff -r 0f7a1d78bc41 -r 7a70d71a69bc OrthancServer/CMakeLists.txt --- a/OrthancServer/CMakeLists.txt Thu Sep 04 08:44:25 2025 +0200 +++ b/OrthancServer/CMakeLists.txt Thu Sep 04 15:05:34 2025 +0200 @@ -471,6 +471,12 @@ target_link_libraries(Orthanc ServerLibrary CoreLibrary ${DCMTK_LIBRARIES}) +# since we use wmain on Windows, we need to tell MinGW to link with wmain +if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_options(Orthanc PRIVATE -municode) +endif() + + if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") # The link flag below hides all the global functions so that a Linux # Standard Base (LSB) build of Orthanc can load plugins that are not @@ -931,6 +937,11 @@ target_link_libraries(OrthancRecoverCompressedFile CoreLibrary) + # since we use wmain on Windows, we need to tell MinGW to link with wmain + if (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_options(OrthancRecoverCompressedFile PRIVATE -municode) + endif() + install( TARGETS OrthancRecoverCompressedFile RUNTIME DESTINATION bin