changeset 167:01248a47aea9

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 11 Apr 2018 12:31:31 +0200
parents 9e67a880d35c (diff) a1b07f1847ad (current diff)
children 0a7203ca1885
files Orthanc/Resources/CMake/BoostConfiguration.cmake Orthanc/Resources/CMake/Compiler.cmake Resources/SyncOrthancFolder.py
diffstat 7 files changed, 42 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/Orthanc/Resources/CMake/BoostConfiguration.cmake	Thu Mar 22 17:13:51 2018 +0100
+++ b/Orthanc/Resources/CMake/BoostConfiguration.cmake	Wed Apr 11 12:31:31 2018 +0200
@@ -53,9 +53,9 @@
   ## Parameters for static compilation of Boost 
   ##
   
-  set(BOOST_NAME boost_1_65_1)
-  set(BOOST_BCP_SUFFIX bcpdigest-1.3.1)
-  set(BOOST_MD5 "92c9c603e56bbd7a450a305f08747d90")
+  set(BOOST_NAME boost_1_66_0)
+  set(BOOST_BCP_SUFFIX bcpdigest-1.3.2)
+  set(BOOST_MD5 "4e15b0fd883528be159be9661b6ba20a")
   set(BOOST_URL "http://www.orthanc-server.com/downloads/third-party/${BOOST_NAME}_${BOOST_BCP_SUFFIX}.tar.gz")
   set(BOOST_SOURCES_DIR ${CMAKE_BINARY_DIR}/${BOOST_NAME})
 
@@ -97,11 +97,13 @@
     )
 
   if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
-    add_definitions(-DBOOST_SYSTEM_USE_STRERROR=1)
+    add_definitions(
+      -DBOOST_SYSTEM_USE_STRERROR=1
+      )
     
     execute_process(
       COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
-      ${ORTHANC_ROOT}/Resources/Patches/boost-1.65.1-linux-standard-base.patch
+      ${ORTHANC_ROOT}/Resources/Patches/boost-1.66.0-linux-standard-base.patch
       WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
       RESULT_VARIABLE Failure
       )
@@ -145,6 +147,7 @@
       )
 
   elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+    # No support for threads in WebAssembly
 
   else()
     message(FATAL_ERROR "Support your platform here")
@@ -254,7 +257,8 @@
             CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD" OR
             CMAKE_SYSTEM_NAME STREQUAL "PNaCl" OR
             CMAKE_SYSTEM_NAME STREQUAL "NaCl32" OR
-            CMAKE_SYSTEM_NAME STREQUAL "NaCl64")
+            CMAKE_SYSTEM_NAME STREQUAL "NaCl64" OR
+            CMAKE_SYSTEM_NAME STREQUAL "Emscripten") # For WebAssembly or asm.js
       list(APPEND BOOST_SOURCES
         ${BOOST_SOURCES_DIR}/libs/locale/src/posix/codecvt.cpp
         ${BOOST_SOURCES_DIR}/libs/locale/src/posix/collate.cpp
--- a/Orthanc/Resources/CMake/Compiler.cmake	Thu Mar 22 17:13:51 2018 +0100
+++ b/Orthanc/Resources/CMake/Compiler.cmake	Wed Apr 11 12:31:31 2018 +0200
@@ -174,6 +174,12 @@
 elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
   message("Building using Emscripten (for WebAssembly or asm.js targets)")
 
+  # The BINARYEN_TRAP_MODE specifies what to do when divisions per
+  # zero (and similar conditions like integer overflows) are
+  # encountered: The "clamp" mode avoids throwing errors, as they
+  # cannot be properly catched by "try {} catch (...)" constructions.
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\", \"cwrap\"]' -s BINARYEN_TRAP_MODE='\"clamp\"'")
+
 else()
   message(FATAL_ERROR "Support your platform here")
 endif()
--- a/Orthanc/Resources/CMake/UuidConfiguration.cmake	Thu Mar 22 17:13:51 2018 +0100
+++ b/Orthanc/Resources/CMake/UuidConfiguration.cmake	Wed Apr 11 12:31:31 2018 +0200
@@ -39,7 +39,7 @@
     check_include_file("sys/un.h"       HAVE_SYS_UN_H)
     check_include_file("unistd.h"       HAVE_UNISTD_H)
 
-    If (NOT HAVE_NET_IF_H)  # This is the case of OpenBSD
+    if (NOT HAVE_NET_IF_H)  # This is the case of OpenBSD
       unset(HAVE_NET_IF_H CACHE)
       check_include_files("sys/socket.h;net/if.h" HAVE_NET_IF_H)
     endif()
@@ -49,7 +49,8 @@
       check_include_files("sys/socket.h;netinet/tcp.h" HAVE_NETINET_TCP_H)
     endif()
 
-    file(WRITE ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake "
+    if (NOT EXISTS ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h)
+      file(WRITE ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake "
 #cmakedefine HAVE_NET_IF_H \@HAVE_NET_IF_H\@
 #cmakedefine HAVE_NET_IF_DL_H \@HAVE_NET_IF_DL_H\@
 #cmakedefine HAVE_NETINET_IN_H \@HAVE_NETINET_IN_H\@
@@ -64,26 +65,23 @@
 #cmakedefine HAVE_SYS_UN_H \@HAVE_SYS_UN_H\@
 #cmakedefine HAVE_UNISTD_H \@HAVE_UNISTD_H\@
 ")
-    
+    endif()
+      
     configure_file(
       ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h.cmake
       ${E2FSPROGS_SOURCES_DIR}/lib/uuid/config.h
       )
-    
-    
+      
     configure_file(
       ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h.in
       ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid.h
       )
 
-    file(WRITE
-      ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h
-      "#include <stdint.h>\n")
-
-    #configure_file(
-    #  ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h.in
-    #  ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h
-    #  )
+    if (NOT EXISTS ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h)
+      file(WRITE
+        ${E2FSPROGS_SOURCES_DIR}/lib/uuid/uuid_types.h
+        "#include <stdint.h>\n")
+    endif()
     
     source_group(ThirdParty\\uuid REGULAR_EXPRESSION ${E2FSPROGS_SOURCES_DIR}/.*)
 
--- a/Orthanc/Resources/LinuxStandardBaseToolchain.cmake	Thu Mar 22 17:13:51 2018 +0100
+++ b/Orthanc/Resources/LinuxStandardBaseToolchain.cmake	Wed Apr 11 12:31:31 2018 +0200
@@ -1,4 +1,4 @@
-# LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake
+# LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../Resources/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON
 
 INCLUDE(CMakeForceCompiler)
 
--- a/Orthanc/Resources/Patches/boost-1.65.1-linux-standard-base.patch	Thu Mar 22 17:13:51 2018 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-diff -urEb boost_1_65_1.orig/boost/move/adl_move_swap.hpp boost_1_65_1/boost/move/adl_move_swap.hpp
---- boost_1_65_1.orig/boost/move/adl_move_swap.hpp	2017-11-08 17:43:20.000000000 +0100
-+++ boost_1_65_1/boost/move/adl_move_swap.hpp	2018-01-02 15:34:48.829052917 +0100
-@@ -28,6 +28,8 @@
- //Try to avoid including <algorithm>, as it's quite big
- #if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB)
-    #include <utility>   //Dinkum libraries define std::swap in utility which is lighter than algorithm
-+#elif defined(__LSB_VERSION__)
-+#  include <utility>
- #elif defined(BOOST_GNU_STDLIB)
-    //For non-GCC compilers, where GNUC version is not very reliable, or old GCC versions
-    //use the good old stl_algobase header, which is quite lightweight
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Orthanc/Resources/Patches/boost-1.66.0-linux-standard-base.patch	Wed Apr 11 12:31:31 2018 +0200
@@ -0,0 +1,13 @@
+diff -urEb boost_1_66_0.orig/boost/move/adl_move_swap.hpp boost_1_66_0/boost/move/adl_move_swap.hpp
+--- boost_1_66_0.orig/boost/move/adl_move_swap.hpp	2018-04-11 11:56:16.761768726 +0200
++++ boost_1_66_0/boost/move/adl_move_swap.hpp	2018-04-11 11:57:01.073881330 +0200
+@@ -28,6 +28,8 @@
+ //Try to avoid including <algorithm>, as it's quite big
+ #if defined(_MSC_VER) && defined(BOOST_DINKUMWARE_STDLIB)
+    #include <utility>   //Dinkum libraries define std::swap in utility which is lighter than algorithm
++#elif defined(__LSB_VERSION__)
++#  include <utility>
+ #elif defined(BOOST_GNU_STDLIB)
+    //For non-GCC compilers, where GNUC version is not very reliable, or old GCC versions
+    //use the good old stl_algobase header, which is quite lightweight
+Only in boost_1_66_0/boost/move: adl_move_swap.hpp~
--- a/Resources/SyncOrthancFolder.py	Thu Mar 22 17:13:51 2018 +0100
+++ b/Resources/SyncOrthancFolder.py	Wed Apr 11 12:31:31 2018 +0200
@@ -31,7 +31,7 @@
     'Resources/MinGW-W64-Toolchain32.cmake',
     'Resources/MinGW-W64-Toolchain64.cmake',
     'Resources/MinGWToolchain.cmake',
-    'Resources/Patches/boost-1.65.1-linux-standard-base.patch',
+    'Resources/Patches/boost-1.66.0-linux-standard-base.patch',
     'Resources/ThirdParty/VisualStudio/stdint.h',
     'Resources/WindowsResources.py',
     'Resources/WindowsResources.rc',