From de1d1025353a41ad8375574b23d3820527705c1e Mon Sep 17 00:00:00 2001 From: Mike Ellery Date: Fri, 22 Feb 2019 15:37:00 -0800 Subject: [PATCH] Allow build to support XCode 10.2 --- CMakeLists.txt | 10 +++++++++- src/test/basics/Buffer_test.cpp | 11 ++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d234121f..b120f1123 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -366,7 +366,6 @@ add_library (opts INTERFACE) add_library (Ripple::opts ALIAS opts) target_compile_definitions (opts INTERFACE - BOOST_ASIO_HAS_STD_ARRAY BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS $<$: BOOST_ASIO_NO_DEPRECATED @@ -567,6 +566,15 @@ target_link_libraries (ripple_boost Boost::system Boost::thread) +# workaround for xcode 10.2 and boost < 1.69 +# once we require Boost 1.69 or higher, this can be removed +# see: https://github.com/boostorg/asio/commit/43874d5 +if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND + CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.1.10010043 AND + Boost_VERSION LESS 106900) + target_compile_definitions (opts INTERFACE BOOST_ASIO_HAS_STD_STRING_VIEW) +endif () + #[===================================================================[ NIH dep: openssl #]===================================================================] diff --git a/src/test/basics/Buffer_test.cpp b/src/test/basics/Buffer_test.cpp index e74fb5231..3933ada7f 100644 --- a/src/test/basics/Buffer_test.cpp +++ b/src/test/basics/Buffer_test.cpp @@ -98,7 +98,9 @@ struct Buffer_test : beast::unit_test::suite x = b0; BEAST_EXPECT (x == b0); BEAST_EXPECT (sane (x)); -#if defined(__clang__) && !defined(__APPLE__) && (__clang_major__ >= 7) +#if defined(__clang__) && \ + (!defined(__APPLE__) && (__clang_major__ >= 7)) || \ + (defined(__APPLE__) && (__apple_build_version__ >= 10010043)) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wself-assign-overloaded" #endif @@ -109,7 +111,10 @@ struct Buffer_test : beast::unit_test::suite y = y; BEAST_EXPECT (y == b3); BEAST_EXPECT (sane (y)); -#if defined(__clang__) && !defined(__APPLE__) && (__clang_major__ >= 7) + +#if defined(__clang__) && \ + (!defined(__APPLE__) && (__clang_major__ >= 7)) || \ + (defined(__APPLE__) && (__apple_build_version__ >= 10010043)) #pragma clang diagnostic pop #endif } @@ -117,7 +122,7 @@ struct Buffer_test : beast::unit_test::suite // Check move constructor & move assignments: { testcase ("Move Construction / Assignment"); - + static_assert(std::is_nothrow_move_constructible::value, ""); static_assert(std::is_nothrow_move_assignable::value, "");