Mercurial > hg > orthanc-dicomweb
changeset 13:e432ee128884
support OS X
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 Apr 2015 15:53:07 +0200 |
parents | db07057d77ad |
children | 1b383403c080 |
files | NEWS Resources/CMake/BoostConfiguration.cmake Resources/Patches/boost-1.55.0-clang-atomic.patch |
diffstat | 3 files changed, 105 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Tue Apr 07 17:13:43 2015 +0200 +++ b/NEWS Thu Apr 30 15:53:07 2015 +0200 @@ -5,6 +5,7 @@ * Support of Visual Studio 2008 * Support of FreeBSD +* Support of OS X 2015/03/13
--- a/Resources/CMake/BoostConfiguration.cmake Tue Apr 07 17:13:43 2015 +0200 +++ b/Resources/CMake/BoostConfiguration.cmake Thu Apr 30 15:53:07 2015 +0200 @@ -93,6 +93,16 @@ ) endif() + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # This is a patch to compile Boost 1.55.0 with Clang 3.4 and later + # (including XCode 5.1). Fixes issue 14 of Orthanc. + # https://trac.macports.org/ticket/42282#comment:10 + execute_process( + COMMAND patch -p0 -i ${CMAKE_SOURCE_DIR}/Resources/Patches/boost-1.55.0-clang-atomic.patch + WORKING_DIRECTORY ${BOOST_SOURCES_DIR} + ) + endif() + ## Boost::filesystem @@ -127,6 +137,13 @@ ${BOOST_SOURCES_DIR}/libs/system/src/error_code.cpp ) + if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") + SET(GCC_ICONV_LINK_FLAGS "-liconv -framework CoreFoundation") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCC_ICONV_LINK_FLAGS}" ) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_ICONV_LINK_FLAGS}" ) + add_definitions(-DBOOST_LOCALE_WITH_ICONV=1) + endif() + source_group(ThirdParty\\Boost REGULAR_EXPRESSION ${BOOST_SOURCES_DIR}/.*) endif()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Patches/boost-1.55.0-clang-atomic.patch Thu Apr 30 15:53:07 2015 +0200 @@ -0,0 +1,87 @@ +--- boost/atomic/detail/cas128strong.hpp ++++ boost/atomic/detail/cas128strong.hpp +@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign> + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void + store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type value_s = 0; ++ storage_type value_s; ++ memset(&value_s, 0, sizeof(value_s)); + memcpy(&value_s, &value, sizeof(value_type)); + platform_fence_before_store(order); + platform_store128(value_s, &v_); +@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign> + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + +--- boost/atomic/detail/gcc-atomic.hpp ++++ boost/atomic/detail/gcc-atomic.hpp +@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign> + + public: + BOOST_DEFAULTED_FUNCTION(base_atomic(void), {}) +- explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0) ++ explicit base_atomic(value_type const& v) BOOST_NOEXCEPT + { ++ memset(&v_, 0, sizeof(v_)); + memcpy(&v_, &v, sizeof(value_type)); + } + + void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + } +@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign> + + value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT + { +- storage_type tmp = 0; ++ storage_type tmp; ++ memset(&tmp, 0, sizeof(tmp)); + memcpy(&tmp, &v, sizeof(value_type)); + tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order)); + value_type res; +@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign> + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false, +@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign> + memory_order success_order, + memory_order failure_order) volatile BOOST_NOEXCEPT + { +- storage_type expected_s = 0, desired_s = 0; ++ storage_type expected_s, desired_s; ++ memset(&expected_s, 0, sizeof(expected_s)); ++ memset(&desired_s, 0, sizeof(desired_s)); + memcpy(&expected_s, &expected, sizeof(value_type)); + memcpy(&desired_s, &desired, sizeof(value_type)); + const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true, +--