changeset 3594:0654d0838de8

disable thread support in DCMTK if wasm/asm.js
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jan 2020 17:59:34 +0100
parents 0301f59450fe
children 0080c9b492e5
files Core/DicomParsing/FromDcmtkBridge.cpp Resources/CMake/DcmtkConfigurationStatic-3.6.2.cmake Resources/CMake/DcmtkConfigurationStatic-3.6.4.cmake
diffstat 3 files changed, 23 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomParsing/FromDcmtkBridge.cpp	Mon Jan 06 17:58:15 2020 +0100
+++ b/Core/DicomParsing/FromDcmtkBridge.cpp	Mon Jan 06 17:59:34 2020 +0100
@@ -177,18 +177,18 @@
     };
 
     
-#define DCMTK_TO_CTYPE_CONVERTER(converter, cType, dcmtkType, getter) \
- \
-    struct converter \
-    { \
-      typedef cType CType; \
- \
-      static bool Apply(CType& result, \
-                        DcmElement& element, \
-                        size_t i) \
-      { \
+#define DCMTK_TO_CTYPE_CONVERTER(converter, cType, dcmtkType, getter)   \
+                                                                        \
+    struct converter                                                    \
+    {                                                                   \
+      typedef cType CType;                                              \
+                                                                        \
+      static bool Apply(CType& result,                                  \
+                        DcmElement& element,                            \
+                        size_t i)                                       \
+      {                                                                 \
         return dynamic_cast<dcmtkType&>(element).getter(result, i).good(); \
-      } \
+      }                                                                 \
     };
 
 DCMTK_TO_CTYPE_CONVERTER(DcmtkToSint32Converter, Sint32, DcmSignedLong, getSint32)
--- a/Resources/CMake/DcmtkConfigurationStatic-3.6.2.cmake	Mon Jan 06 17:58:15 2020 +0100
+++ b/Resources/CMake/DcmtkConfigurationStatic-3.6.2.cmake	Mon Jan 06 17:59:34 2020 +0100
@@ -12,7 +12,12 @@
 
 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/)
 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
-set(DCMTK_WITH_THREADS ON)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+  set(DCMTK_WITH_THREADS OFF)  # Disable thread support in wasm/asm.js
+else()
+  set(DCMTK_WITH_THREADS ON)
+endif()
 
 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)
 
--- a/Resources/CMake/DcmtkConfigurationStatic-3.6.4.cmake	Mon Jan 06 17:58:15 2020 +0100
+++ b/Resources/CMake/DcmtkConfigurationStatic-3.6.4.cmake	Mon Jan 06 17:59:34 2020 +0100
@@ -12,7 +12,12 @@
 
 set(DCMTK_BINARY_DIR ${DCMTK_SOURCES_DIR}/)
 set(DCMTK_CMAKE_INCLUDE ${DCMTK_SOURCES_DIR}/)
-set(DCMTK_WITH_THREADS ON)
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+  set(DCMTK_WITH_THREADS OFF)  # Disable thread support in wasm/asm.js
+else()
+  set(DCMTK_WITH_THREADS ON)
+endif()
 
 add_definitions(-DDCMTK_INSIDE_LOG4CPLUS=1)