changeset 6297:7a70d71a69bc utf8-path

try to fix mingw build
author Alain Mazy <am@orthanc.team>
date Thu, 04 Sep 2025 15:05:34 +0200
parents 0f7a1d78bc41
children 96619f473bee
files OrthancServer/CMakeLists.txt
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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