diff --git a/README.md b/README.md index 87d621a..8f8078d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,38 @@ This library is a C++11 compatible implementation of ``. The full documentation can be found here: https://develop.charconv.cpp.al # Notice -This library is not an official boost library, and is under active development. +This library is not an official boost library. + +# How to build the library + +## B2 + +```` +git clone https://github.com/boostorg/boost +cd boost +git submodule update --init +cd libs +git clone https://github.com/cppalliance/charconv +cd .. +./bootstrap +./b2 cxxstd=11 +```` + +This sets up a complete boost development and allows the tests to be run. To install the development environment run: + +```` +sudo ./b2 install cxxstd=11 +```` + +## vcpkg + +```` +git clone https://github.com/cppalliance/charconv +cd charconv +vcpkg install charconv --overlay-ports=ports/charconv +```` + +This will install charconv and all the required boost packages if they do not already exist. # Synopsis diff --git a/ports/charconv/b2-options.cmake b/ports/charconv/b2-options.cmake new file mode 100644 index 0000000..e632dcc --- /dev/null +++ b/ports/charconv/b2-options.cmake @@ -0,0 +1,7 @@ +# Copyright 2023 Matt Borland +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt + +if(APPLE) + list(APPEND B2_OPTIONS cxxstd=11) +endif() diff --git a/ports/charconv/portfile.cmake b/ports/charconv/portfile.cmake new file mode 100644 index 0000000..23366e0 --- /dev/null +++ b/ports/charconv/portfile.cmake @@ -0,0 +1,27 @@ +# Copyright 2023 Matt Borland +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt +# +# See: https://devblogs.microsoft.com/cppblog/registries-bring-your-own-libraries-to-vcpkg/ + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO cppalliance/charconv + REF e709ea5705e88faefb1dba9f12108b341f3e44c2 + SHA512 3d6f0fdc7447366e2fa135ff31138db2ce6309fb066240a37529f1ea87ad0c1ed79a1c22d38ceeb6f1f7e7353bc928a0e8702d615c20e12f27f6c336f6a83ad6 + HEAD_REF develop +) + +vcpkg_replace_string("${SOURCE_PATH}/build/Jamfile" + "import ../../config/checks/config" + "import ../config/checks/config" +) + +file(COPY "${CURRENT_INSTALLED_DIR}/share/boost-config/checks" DESTINATION "${SOURCE_PATH}/config") +include(${CURRENT_HOST_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake) +boost_modular_build( + SOURCE_PATH ${SOURCE_PATH} + BOOST_CMAKE_FRAGMENT "${CMAKE_CURRENT_LIST_DIR}/b2-options.cmake" +) +include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) +boost_modular_headers(SOURCE_PATH ${SOURCE_PATH}) diff --git a/ports/charconv/vcpkg.json b/ports/charconv/vcpkg.json new file mode 100644 index 0000000..e5a72c2 --- /dev/null +++ b/ports/charconv/vcpkg.json @@ -0,0 +1,38 @@ +{ + "name": "charconv", + "version": "1.83.0", + "description": "A C++11 implementation of ", + "homepage": "https://github.com/cppalliance/charconv", + "dependencies": [ + { + "name": "boost-build", + "host": true, + "version>=": "1.81.0" + }, + { + "name": "boost-modular-build-helper", + "host": true, + "version>=": "1.81.0" + }, + { + "name": "boost-config", + "version>=": "1.81.0" + }, + { + "name": "boost-assert", + "version>=": "1.81.0" + }, + { + "name": "boost-core", + "version>=": "1.81.0" + }, + { + "name": "boost-vcpkg-helpers", + "version>=": "1.81.0" + }, + { + "name": "vcpkg-cmake", + "host": true + } + ] +}