changeset 4018:9d2d2c1afcec

fix build with recent versions of Emscripten
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 08 Jun 2020 22:43:58 +0200
parents c783f4f29390
children bf35c4628777 320cde762fd9
files Resources/CMake/DcmtkConfiguration.cmake Resources/Patches/dcmtk-3.6.5.patch
diffstat 2 files changed, 39 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/DcmtkConfiguration.cmake	Mon Jun 08 18:15:31 2020 +0200
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Mon Jun 08 22:43:58 2020 +0200
@@ -29,6 +29,13 @@
     ${DCMTK_SOURCES_DIR}/dcmdata/libsrc/dcdict_orthanc.cc
     )
 
+  if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+    message(${DCMTK_SOURCES_DIR})
+    list(REMOVE_ITEM DCMTK_SOURCES 
+      ${DCMTK_SOURCES_DIR}/ofstd/libsrc/offilsys.cc
+      )
+  endif()
+
   if (ENABLE_DCMTK_NETWORKING)
     AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/dcmnet/libsrc DCMTK_SOURCES)
     include_directories(
--- a/Resources/Patches/dcmtk-3.6.5.patch	Mon Jun 08 18:15:31 2020 +0200
+++ b/Resources/Patches/dcmtk-3.6.5.patch	Mon Jun 08 22:43:58 2020 +0200
@@ -1,6 +1,26 @@
+diff -urEb dcmtk-3.6.5.orig/CMake/GenerateDCMTKConfigure.cmake dcmtk-3.6.5/CMake/GenerateDCMTKConfigure.cmake
+--- dcmtk-3.6.5.orig/CMake/GenerateDCMTKConfigure.cmake	2020-06-08 22:19:03.265799573 +0200
++++ dcmtk-3.6.5/CMake/GenerateDCMTKConfigure.cmake	2020-06-08 22:21:22.670025141 +0200
+@@ -169,6 +169,8 @@
+ endif()
+ 
+ # Check the sizes of various types
++if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
++  # This doesn't work for wasm, Orthanc defines the macros manually
+ include (CheckTypeSize)
+ CHECK_TYPE_SIZE("char" SIZEOF_CHAR)
+ CHECK_TYPE_SIZE("double" SIZEOF_DOUBLE)
+@@ -177,6 +179,7 @@
+ CHECK_TYPE_SIZE("long" SIZEOF_LONG)
+ CHECK_TYPE_SIZE("short" SIZEOF_SHORT)
+ CHECK_TYPE_SIZE("void*" SIZEOF_VOID_P)
++endif()
+ 
+ # Check for include files, libraries, and functions
+ include("${DCMTK_CMAKE_INCLUDE}CMake/dcmtkTryCompile.cmake")
 diff -urEb dcmtk-3.6.5.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h dcmtk-3.6.5/dcmdata/include/dcmtk/dcmdata/dcdict.h
---- dcmtk-3.6.5.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h	2020-03-18 10:22:41.555166774 +0100
-+++ dcmtk-3.6.5/dcmdata/include/dcmtk/dcmdata/dcdict.h	2020-03-18 10:22:53.395131056 +0100
+--- dcmtk-3.6.5.orig/dcmdata/include/dcmtk/dcmdata/dcdict.h	2020-06-08 22:19:03.229799498 +0200
++++ dcmtk-3.6.5/dcmdata/include/dcmtk/dcmdata/dcdict.h	2020-06-08 22:19:35.317862998 +0200
 @@ -152,6 +152,12 @@
      /// returns an iterator to the end of the repeating tag dictionary
      DcmDictEntryListIterator repeatingEnd() { return repDict.end(); }
@@ -15,8 +35,8 @@
  
      /** private undefined assignment operator
 diff -urEb dcmtk-3.6.5.orig/dcmdata/libsrc/dcdict.cc dcmtk-3.6.5/dcmdata/libsrc/dcdict.cc
---- dcmtk-3.6.5.orig/dcmdata/libsrc/dcdict.cc	2020-03-18 10:22:41.559166762 +0100
-+++ dcmtk-3.6.5/dcmdata/libsrc/dcdict.cc	2020-03-18 10:22:53.395131056 +0100
+--- dcmtk-3.6.5.orig/dcmdata/libsrc/dcdict.cc	2020-06-08 22:19:03.245799531 +0200
++++ dcmtk-3.6.5/dcmdata/libsrc/dcdict.cc	2020-06-08 22:19:35.317862998 +0200
 @@ -900,3 +900,6 @@
    wrlock().clear();
    wrunlock();
@@ -25,8 +45,8 @@
 +
 +#include "dcdict_orthanc.cc"
 diff -urEb dcmtk-3.6.5.orig/dcmdata/libsrc/dcpxitem.cc dcmtk-3.6.5/dcmdata/libsrc/dcpxitem.cc
---- dcmtk-3.6.5.orig/dcmdata/libsrc/dcpxitem.cc	2020-03-18 10:22:41.559166762 +0100
-+++ dcmtk-3.6.5/dcmdata/libsrc/dcpxitem.cc	2020-03-18 10:22:53.395131056 +0100
+--- dcmtk-3.6.5.orig/dcmdata/libsrc/dcpxitem.cc	2020-06-08 22:19:03.245799531 +0200
++++ dcmtk-3.6.5/dcmdata/libsrc/dcpxitem.cc	2020-06-08 22:19:35.317862998 +0200
 @@ -36,6 +36,9 @@
  #include "dcmtk/dcmdata/dcostrma.h"    /* for class DcmOutputStream */
  #include "dcmtk/dcmdata/dcwcache.h"    /* for class DcmWriteCache */
@@ -38,8 +58,8 @@
  // ********************************
  
 diff -urEb dcmtk-3.6.5.orig/oflog/include/dcmtk/oflog/thread/syncpub.h dcmtk-3.6.5/oflog/include/dcmtk/oflog/thread/syncpub.h
---- dcmtk-3.6.5.orig/oflog/include/dcmtk/oflog/thread/syncpub.h	2020-03-18 10:22:41.543166810 +0100
-+++ dcmtk-3.6.5/oflog/include/dcmtk/oflog/thread/syncpub.h	2020-03-18 10:22:53.395131056 +0100
+--- dcmtk-3.6.5.orig/oflog/include/dcmtk/oflog/thread/syncpub.h	2020-06-08 22:19:03.261799565 +0200
++++ dcmtk-3.6.5/oflog/include/dcmtk/oflog/thread/syncpub.h	2020-06-08 22:19:35.317862998 +0200
 @@ -63,7 +63,7 @@
  
  DCMTK_LOG4CPLUS_INLINE_EXPORT
@@ -86,8 +106,8 @@
  
  
 diff -urEb dcmtk-3.6.5.orig/oflog/libsrc/oflog.cc dcmtk-3.6.5/oflog/libsrc/oflog.cc
---- dcmtk-3.6.5.orig/oflog/libsrc/oflog.cc	2020-03-18 10:22:41.547166798 +0100
-+++ dcmtk-3.6.5/oflog/libsrc/oflog.cc	2020-03-18 11:55:50.116856932 +0100
+--- dcmtk-3.6.5.orig/oflog/libsrc/oflog.cc	2020-06-08 22:19:03.261799565 +0200
++++ dcmtk-3.6.5/oflog/libsrc/oflog.cc	2020-06-08 22:19:35.317862998 +0200
 @@ -19,6 +19,10 @@
   *
   */
@@ -100,8 +120,8 @@
  #include "dcmtk/oflog/oflog.h"
  
 diff -urEb dcmtk-3.6.5.orig/ofstd/include/dcmtk/ofstd/offile.h dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/offile.h
---- dcmtk-3.6.5.orig/ofstd/include/dcmtk/ofstd/offile.h	2020-03-18 10:22:41.587166677 +0100
-+++ dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/offile.h	2020-03-18 10:22:53.395131056 +0100
+--- dcmtk-3.6.5.orig/ofstd/include/dcmtk/ofstd/offile.h	2020-06-08 22:19:03.293799632 +0200
++++ dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/offile.h	2020-06-08 22:19:35.317862998 +0200
 @@ -575,7 +575,7 @@
     */
    void setlinebuf()