From d7e715c26a7210b5c5c535cba9ffd9fe502aa988 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 17 Aug 2023 11:38:09 -0400 Subject: [PATCH 1/3] Add vcpkg build --- ports/charconv/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ ports/charconv/vcpkg.json | 7 +++++++ 2 files changed, 41 insertions(+) create mode 100644 ports/charconv/portfile.cmake create mode 100644 ports/charconv/vcpkg.json diff --git a/ports/charconv/portfile.cmake b/ports/charconv/portfile.cmake new file mode 100644 index 0000000..acfd4c4 --- /dev/null +++ b/ports/charconv/portfile.cmake @@ -0,0 +1,34 @@ +# 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_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_TESTING=OFF +) + +vcpkg_install_cmake() +vcpkg_fixup_cmake_targets() + +file( + INSTALL + ${SOURCE_PATH}/LICENSE + + DESTINATION + ${CURRENT_PACKAGES_DIR}/share/${PORT} + + RENAME + copyright +) diff --git a/ports/charconv/vcpkg.json b/ports/charconv/vcpkg.json new file mode 100644 index 0000000..c3f171b --- /dev/null +++ b/ports/charconv/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "charconv", + "version": "1.83.0", + "description": "A C++11 implementation of ", + "homepage": "https://github.com/cppalliance/charconv", + "dependencies": [ "boost-config", "boost-assert", "boost-core" ] +} From d1500fec16abfb377864247f5fe7df5d4e168dd3 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 17 Aug 2023 12:08:29 -0400 Subject: [PATCH 2/3] Add boost-modular build helpers --- ports/charconv/b2-options.cmake | 7 +++++++ ports/charconv/portfile.cmake | 29 +++++++++++------------------ ports/charconv/vcpkg.json | 33 ++++++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 ports/charconv/b2-options.cmake 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 index acfd4c4..23366e0 100644 --- a/ports/charconv/portfile.cmake +++ b/ports/charconv/portfile.cmake @@ -12,23 +12,16 @@ vcpkg_from_github( HEAD_REF develop ) -vcpkg_configure_cmake( +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} - PREFER_NINJA - OPTIONS - -DBUILD_TESTING=OFF -) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() - -file( - INSTALL - ${SOURCE_PATH}/LICENSE - - DESTINATION - ${CURRENT_PACKAGES_DIR}/share/${PORT} - - RENAME - copyright + 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 index c3f171b..e5a72c2 100644 --- a/ports/charconv/vcpkg.json +++ b/ports/charconv/vcpkg.json @@ -3,5 +3,36 @@ "version": "1.83.0", "description": "A C++11 implementation of ", "homepage": "https://github.com/cppalliance/charconv", - "dependencies": [ "boost-config", "boost-assert", "boost-core" ] + "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 + } + ] } From 50ca86001f398ff55b519469290faac36474a2d9 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 17 Aug 2023 13:28:37 -0400 Subject: [PATCH 3/3] Add directions to build the library to the README --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) 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