# Copyright 2022 Peter Dimov
# Copyright 2023 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt

require-b2 5.0.1 ;
import-search /boost/config/checks ;

import config : requires ;

project : common-requirements <library>$(boost_dependencies) ;

local SOURCES = from_chars.cpp to_chars.cpp ;

lib quadmath ;

lib boost_charconv

  # sources
  : ../src/$(SOURCES)

  # requirements
  : <link>shared:<define>BOOST_CHARCONV_DYN_LINK=1
    <define>BOOST_CHARCONV_SOURCE=1

    [ requires cxx11_variadic_templates cxx11_decltype ]
    [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <library>"quadmath" <define>BOOST_CHARCONV_HAS_QUADMATH ]

  # default-build
  :

  # usage-requirements
  : <link>shared:<define>BOOST_CHARCONV_DYN_LINK=1
    <define>BOOST_CHARCONV_NO_LIB=1

    [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : <library>"quadmath" <define>BOOST_CHARCONV_HAS_QUADMATH ]
;
