diff --git a/CMakeLists.txt b/CMakeLists.txt index dc45d7aa..bb91bbe1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,6 @@ # Generated by `boostdep --cmake multiprecision` # Copyright 2020 Peter Dimov +# Copyright 2021 Matt Borland # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt @@ -12,18 +13,30 @@ add_library(Boost::multiprecision ALIAS boost_multiprecision) target_include_directories(boost_multiprecision INTERFACE include) -target_link_libraries(boost_multiprecision - INTERFACE - Boost::assert - Boost::config - Boost::core - Boost::integer - Boost::lexical_cast - Boost::math - Boost::predef - Boost::random - Boost::rational -) +include(CMakeDependentOption) + +cmake_dependent_option(BOOST_MP_STANDALONE "Use Boost.Multiprecision in standalone mode" ON "NOT BOOST_SUPERPROJECT_VERSION" OFF) + +message(STATUS "Boost.Multiprecision: standalone mode ${BOOST_MP_STANDALONE}") + +if(BOOST_MP_STANDALONE) + + target_compile_definitions(boost_multiprecision INTERFACE BOOST_MP_STANDALONE=1) + +else() + + target_link_libraries(boost_multiprecision + INTERFACE + Boost::assert + Boost::config + Boost::core + Boost::integer + Boost::lexical_cast + Boost::math + Boost::random + ) + +endif() if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") diff --git a/include/boost/multiprecision/detail/default_ops.hpp b/include/boost/multiprecision/detail/default_ops.hpp index c6763d70..9b4fbd69 100644 --- a/include/boost/multiprecision/detail/default_ops.hpp +++ b/include/boost/multiprecision/detail/default_ops.hpp @@ -2257,13 +2257,13 @@ imag(const multiprecision::detail::expression& arg) // expression template versions here, plus overloads for non-complex types: // template -inline BOOST_MP_CXX14_CONSTEXPR typename boost::lazy_enable_if_c::value == number_kind_complex, component_type > >::type +inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value == number_kind_complex, component_type>>::type::type abs(const number& v) { return std::move(boost::math::hypot(real(v), imag(v))); } template -inline BOOST_MP_CXX14_CONSTEXPR typename boost::lazy_enable_if_c::result_type>::value == number_kind_complex, component_type::result_type> >::type +inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::result_type>::value == number_kind_complex, component_type::result_type>>::type::type abs(const detail::expression& v) { using number_type = typename detail::expression::result_type; @@ -2291,7 +2291,7 @@ arg(const detail::expression& v) } template -inline BOOST_MP_CXX14_CONSTEXPR typename boost::lazy_enable_if_c::value == number_kind_complex, component_type > >::type +inline BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value == number_kind_complex, component_type>>::type::type norm(const number& v) { typename component_type >::type a(real(v)), b(imag(v));