Mathieu Malaterre pushed to branch master at Debian Med / orthanc
Commits: 537fbfec by Adrian Bunk at 2021-11-22T17:20:14+02:00 More complete fix to remove forcing C++ 11 - - - - - af9c6ab4 by Mathieu Malaterre at 2021-11-23T07:34:04+00:00 Merge branch 'master' into 'master' More complete fix to remove forcing C++ 11 See merge request med-team/orthanc!1 - - - - - 1 changed file: - debian/patches/donotforcec++11.patch Changes: ===================================== debian/patches/donotforcec++11.patch ===================================== @@ -1,15 +1,96 @@ Description: Remove hardcoded c++11 -Author: Mathieu Malaterre <ma...@debian.org> Bug-Debian: https://bugs.debian.org/1000222 -Reviewed-by: Sébastien Jodogne <s.jodo...@orthanc-labs.com> -Last-Update: 2021-11-22 ---- orthanc-1.9.7+dfsg.orig/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake -+++ orthanc-1.9.7+dfsg/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake -@@ -98,11 +98,11 @@ if (JSONCPP_CXX11) +diff --git a/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake b/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake +index 41177d3..db2468c 100644 +--- a/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake ++++ b/OrthancFramework/Resources/CMake/DownloadOrthancFramework.cmake +@@ -498,35 +498,6 @@ if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") + message(FATAL_ERROR "Please install the libjsoncpp-dev package") + endif() + +- # Switch to the C++11 standard if the version of JsonCpp is 1.y.z +- # (same as variable JSONCPP_CXX11 in the source code of Orthanc) +- if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h) +- file(STRINGS +- "${JSONCPP_INCLUDE_DIR}/json/version.h" +- JSONCPP_VERSION_MAJOR1 REGEX +- ".*define JSONCPP_VERSION_MAJOR.*") +- +- if (NOT JSONCPP_VERSION_MAJOR1) +- message(FATAL_ERROR "Unable to extract the major version of JsonCpp") +- endif() +- +- string(REGEX REPLACE +- ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1" +- JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1}) +- message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}") +- +- if (JSONCPP_VERSION_MAJOR GREATER 0) +- message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0") +- if (CMAKE_COMPILER_IS_GNUCXX) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") +- elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +- endif() +- endif() +- else() +- message("Unable to detect the major version of JsonCpp, assuming < 1.0.0") +- endif() +- + # Look for Orthanc framework shared library + include(CheckCXXSymbolExists) + +diff --git a/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake b/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake +index 3c06f65..2a64ec4 100644 +--- a/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake ++++ b/OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake +@@ -18,7 +18,7 @@ + # <http://www.gnu.org/licenses/>. + + +-set(JSONCPP_CXX11 OFF) ++set(JSONCPP_INCREASE_STACK_LIMIT OFF) + + if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP) + if (USE_LEGACY_JSONCPP) +@@ -31,7 +31,7 @@ if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP) + set(JSONCPP_URL "http://orthanc.osimis.io/ThirdPartyDownloads/jsoncpp-1.9.4.tar.gz") + set(JSONCPP_MD5 "4757b26ec89798c5247fa638edfdc446") + add_definitions(-DORTHANC_LEGACY_JSONCPP=0) +- set(JSONCPP_CXX11 ON) ++ set(JSONCPP_INCREASE_STACK_LIMIT ON) + endif() + + DownloadPackage(${JSONCPP_MD5} ${JSONCPP_URL} "${JSONCPP_SOURCES_DIR}") +@@ -67,7 +67,6 @@ else() + message(FATAL_ERROR "Please install the libjsoncpp-dev package") + endif() + +- # Switch to the C++11 standard if the version of JsonCpp is 1.y.z + if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h) + file(STRINGS + "${JSONCPP_INCLUDE_DIR}/json/version.h" +@@ -84,7 +83,7 @@ else() + message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}") + + if (JSONCPP_VERSION_MAJOR GREATER 0) +- set(JSONCPP_CXX11 ON) ++ set(JSONCPP_INCREASE_STACK_LIMIT ON) + endif() + else() + message("Unable to detect the major version of JsonCpp, assuming < 1.0.0") +@@ -92,17 +91,9 @@ else() + endif() + + +-if (JSONCPP_CXX11) ++if (JSONCPP_INCREASE_STACK_LIMIT) + # Osimis has encountered problems when this macro is left at its + # default value (1000), so we increase this limit # https://gitlab.kitware.com/third-party/jsoncpp/commit/56df2068470241f9043b676bfae415ed62a0c172 add_definitions(-DJSONCPP_DEPRECATED_STACK_LIMIT=5000) - +- - if (CMAKE_COMPILER_IS_GNUCXX) - message("Switching to C++11 standard in gcc, as version of JsonCpp is >= 1.0.0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") @@ -17,11 +98,4 @@ Last-Update: 2021-11-22 - message("Switching to C++11 standard in clang, as version of JsonCpp is >= 1.0.0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - endif() -+ #if (CMAKE_COMPILER_IS_GNUCXX) -+ # message("Switching to C++11 standard in gcc, as version of JsonCpp is >= 1.0.0") -+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") -+ #elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") -+ # message("Switching to C++11 standard in clang, as version of JsonCpp is >= 1.0.0") -+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -+ #endif() endif() View it on GitLab: https://salsa.debian.org/med-team/orthanc/-/compare/51181f2c0c7411d0946fe761f714999dbb4382f9...af9c6ab4623eb25ff4111a99533873932a5cdd39 -- View it on GitLab: https://salsa.debian.org/med-team/orthanc/-/compare/51181f2c0c7411d0946fe761f714999dbb4382f9...af9c6ab4623eb25ff4111a99533873932a5cdd39 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ debian-med-commit mailing list debian-med-com...@alioth-lists.debian.net https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit