Merge pull request #76 from cppalliance/portfile

Add vcpkg build
This commit is contained in:
Matt Borland
2023-08-18 08:23:54 -04:00
committed by GitHub
4 changed files with 104 additions and 1 deletions

View File

@@ -2,7 +2,38 @@
This library is a C++11 compatible implementation of `<charconv>`. 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

View File

@@ -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()

View File

@@ -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})

38
ports/charconv/vcpkg.json Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "charconv",
"version": "1.83.0",
"description": "A C++11 implementation of <charconv>",
"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
}
]
}