Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/cppalliance/http_io/
# Official repository: https://github.com/cppalliance/beast2
#

name: CI
Expand Down Expand Up @@ -880,7 +880,7 @@ jobs:
buffers-root
rts-root
scan-modules-ignore: |
http_io
beast2
http_proto
buffers
rts
Expand Down Expand Up @@ -969,7 +969,7 @@ jobs:
ASAN_OPTIONS: ${{ (startsWith(matrix.compiler, 'apple-clang') && 'detect_invalid_pointer_pairs=0') || 'detect_invalid_pointer_pairs=2' }}
with:
source-dir: boost-root
modules: http_io
modules: beast2
toolset: ${{ matrix.b2-toolset }}
build-variant: ${{ matrix.build-type }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }}
Expand All @@ -982,7 +982,7 @@ jobs:
cxxflags: ${{ (matrix.asan && '-fsanitize=pointer-subtract') || '' }}
user-config: ${{ ((startsWith(matrix.runs-on, 'windows') || startsWith(matrix.runs-on, 'macOS')) && format('{0}/user-config.jam', steps.patch.outputs.workspace_root)) || '' }}
stop-on-error: true
extra-args: "libs/http_io/example" # https://github.com/ashtum/cpp-actions/issues/23
extra-args: "libs/beast2/example" # https://github.com/ashtum/cpp-actions/issues/23

- name: Boost CMake Workflow
uses: ashtum/cpp-actions/cmake-workflow@v1.8.13
Expand All @@ -1005,11 +1005,11 @@ jobs:
extra-args: |
-D Boost_VERBOSE=ON
-D BOOST_INCLUDE_LIBRARIES="${{ steps.patch.outputs.module }}"
-D BOOST_HTTP_IO_BUILD_TESTS=ON
-D BOOST_BEAST2_BUILD_TESTS=ON
export-compile-commands: ${{ matrix.time-trace }}
package: false
package-artifact: false
ref-source-dir: boost-root/libs/http_io
ref-source-dir: boost-root/libs/beast2
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}

- name: Set Path
Expand Down Expand Up @@ -1041,7 +1041,7 @@ jobs:
extra-args: |
-D BOOST_CI_INSTALL_TEST=ON
-D CMAKE_PREFIX_PATH=${{ steps.patch.outputs.workspace_root }}/.local
ref-source-dir: boost-root/libs/http_io
ref-source-dir: boost-root/libs/beast2
trace-commands: true
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}

Expand All @@ -1063,7 +1063,7 @@ jobs:
install: false
cmake-version: '>=3.20'
extra-args: -D BOOST_CI_INSTALL_TEST=OFF
ref-source-dir: boost-root/libs/http_io/test/cmake_test
ref-source-dir: boost-root/libs/beast2/test/cmake_test
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}

- name: Root Project CMake Workflow
Expand Down Expand Up @@ -1093,7 +1093,7 @@ jobs:
uses: ashtum/cpp-actions/flamegraph@v1.8.13
if: matrix.time-trace
with:
source-dir: boost-root/libs/http_io
source-dir: boost-root/libs/beast2
build-dir: boost-root/__build_cmake_test__
github_token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -1209,7 +1209,7 @@ jobs:
buffers-root
rts-root
scan-modules-ignore: |
http_io
beast2
http_proto
buffers
rts
Expand Down Expand Up @@ -1265,7 +1265,7 @@ jobs:

BOOST_SRC_DIR="$(pwd)/boost-root"
export BOOST_SRC_DIR
cd boost-root/libs/http_io
cd boost-root/libs/beast2

cd doc
bash ./build_antora.sh
Expand All @@ -1280,4 +1280,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: antora-docs-${{ matrix.name }}
path: boost-root/libs/http_io/doc/build/site
path: boost-root/libs/beast2/doc/build/site
84 changes: 42 additions & 42 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/cppalliance/http_io
# Official repository: https://github.com/cppalliance/beast2
#

#-------------------------------------------------
Expand All @@ -16,14 +16,14 @@
#
#-------------------------------------------------
cmake_minimum_required(VERSION 3.8...3.20)
set(BOOST_HTTP_IO_VERSION 1)
set(BOOST_BEAST2_VERSION 1)
if (BOOST_SUPERPROJECT_VERSION)
set(BOOST_HTTP_IO_VERSION ${BOOST_SUPERPROJECT_VERSION})
set(BOOST_BEAST2_VERSION ${BOOST_SUPERPROJECT_VERSION})
endif ()
project(boost_http_io VERSION "${BOOST_HTTP_IO_VERSION}" LANGUAGES CXX)
set(BOOST_HTTP_IO_IS_ROOT OFF)
project(boost_beast2 VERSION "${BOOST_BEAST2_VERSION}" LANGUAGES CXX)
set(BOOST_BEAST2_IS_ROOT OFF)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(BOOST_HTTP_IO_IS_ROOT ON)
set(BOOST_BEAST2_IS_ROOT ON)
endif ()
set(__ignore__ ${CMAKE_C_COMPILER})

Expand All @@ -32,12 +32,12 @@ set(__ignore__ ${CMAKE_C_COMPILER})
# Options
#
#-------------------------------------------------
if (BOOST_HTTP_IO_IS_ROOT)
if (BOOST_BEAST2_IS_ROOT)
include(CTest)
endif ()
option(BOOST_HTTP_IO_BUILD_TESTS "Build boost::http_io tests" ${BUILD_TESTING})
option(BOOST_HTTP_IO_BUILD_EXAMPLES "Build boost::http_io examples" ${BOOST_HTTP_IO_IS_ROOT})
option(BOOST_HTTP_IO_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)
option(BOOST_BEAST2_BUILD_TESTS "Build boost::beast2 tests" ${BUILD_TESTING})
option(BOOST_BEAST2_BUILD_EXAMPLES "Build boost::beast2 examples" ${BOOST_BEAST2_IS_ROOT})
option(BOOST_BEAST2_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)


# Check if environment variable BOOST_SRC_DIR is set
Expand All @@ -54,7 +54,7 @@ set(BOOST_SRC_DIR ${DEFAULT_BOOST_SRC_DIR} CACHE STRING "Boost source dir to use
#
#-------------------------------------------------
# The boost super-project requires one explicit dependency per-line.
set(BOOST_HTTP_IO_DEPENDENCIES
set(BOOST_BEAST2_DEPENDENCIES
Boost::asio
Boost::assert
Boost::config
Expand All @@ -63,28 +63,28 @@ set(BOOST_HTTP_IO_DEPENDENCIES
Boost::throw_exception
)

foreach (BOOST_HTTP_IO_DEPENDENCY ${BOOST_HTTP_IO_DEPENDENCIES})
if (BOOST_HTTP_IO_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$")
list(APPEND BOOST_HTTP_IO_INCLUDE_LIBRARIES ${CMAKE_MATCH_1})
foreach (BOOST_BEAST2_DEPENDENCY ${BOOST_BEAST2_DEPENDENCIES})
if (BOOST_BEAST2_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$")
list(APPEND BOOST_BEAST2_INCLUDE_LIBRARIES ${CMAKE_MATCH_1})
endif ()
endforeach ()
# Conditional dependencies
if (BOOST_HTTP_IO_BUILD_TESTS)
set(BOOST_HTTP_IO_UNIT_TEST_LIBRARIES beast url)
if (BOOST_BEAST2_BUILD_TESTS)
set(BOOST_BEAST2_UNIT_TEST_LIBRARIES beast url)
endif ()
if (BOOST_HTTP_IO_BUILD_EXAMPLES)
set(BOOST_HTTP_IO_EXAMPLE_LIBRARIES json program_options scope url multiprecision)
if (BOOST_BEAST2_BUILD_EXAMPLES)
set(BOOST_BEAST2_EXAMPLE_LIBRARIES json program_options scope url multiprecision)
endif ()
# Complete dependency list
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_IO_INCLUDE_LIBRARIES} ${BOOST_HTTP_IO_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_IO_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES http_io)
set(BOOST_INCLUDE_LIBRARIES ${BOOST_BEAST2_INCLUDE_LIBRARIES} ${BOOST_BEAST2_UNIT_TEST_LIBRARIES} ${BOOST_BEAST2_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES beast2)

#-------------------------------------------------
#
# Add Boost Subdirectory
#
#-------------------------------------------------
if (BOOST_HTTP_IO_IS_ROOT)
if (BOOST_BEAST2_IS_ROOT)
set(CMAKE_FOLDER Dependencies)
# Find absolute BOOST_SRC_DIR
if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR})
Expand Down Expand Up @@ -132,50 +132,50 @@ endif ()
#-------------------------------------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

file(GLOB_RECURSE BOOST_HTTP_IO_HEADERS CONFIGURE_DEPENDS include/boost/http_io/*.hpp include/boost/*.natvis)
file(GLOB_RECURSE BOOST_HTTP_IO_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)
file(GLOB_RECURSE BOOST_BEAST2_HEADERS CONFIGURE_DEPENDS include/boost/beast2/*.hpp include/boost/*.natvis)
file(GLOB_RECURSE BOOST_BEAST2_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)

source_group("" FILES "include/boost/http_io.hpp" "build/Jamfile")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http_io PREFIX "include" FILES ${BOOST_HTTP_IO_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_IO_SOURCES})
source_group("" FILES "include/boost/beast2.hpp" "build/Jamfile")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/beast2 PREFIX "include" FILES ${BOOST_BEAST2_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_BEAST2_SOURCES})


function(boost_http_io_setup_properties target)
function(boost_beast2_setup_properties target)
target_compile_features(${target} PUBLIC cxx_constexpr)
target_include_directories(${target} PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_link_libraries(${target} PUBLIC ${BOOST_HTTP_IO_DEPENDENCIES})
target_link_libraries(${target} PUBLIC ${BOOST_BEAST2_DEPENDENCIES})
find_package(Threads REQUIRED)
target_link_libraries(${target} PUBLIC Threads::Threads)
if (MINGW)
target_link_libraries(${target} PUBLIC ws2_32 wsock32)
endif()
target_compile_definitions(${target} PUBLIC BOOST_HTTP_IO_NO_LIB)
target_compile_definitions(${target} PRIVATE BOOST_HTTP_IO_SOURCE)
target_compile_definitions(${target} PUBLIC BOOST_BEAST2_NO_LIB)
target_compile_definitions(${target} PRIVATE BOOST_BEAST2_SOURCE)
if (BUILD_SHARED_LIBS)
target_compile_definitions(${target} PUBLIC BOOST_HTTP_IO_DYN_LINK)
target_compile_definitions(${target} PUBLIC BOOST_BEAST2_DYN_LINK)
else ()
target_compile_definitions(${target} PUBLIC BOOST_HTTP_IO_STATIC_LINK)
target_compile_definitions(${target} PUBLIC BOOST_BEAST2_STATIC_LINK)
endif ()
endfunction()

if (BOOST_HTTP_IO_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/http_io.hpp>\n")
add_library(boost_http_io_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
boost_http_io_setup_properties(boost_http_io_mrdocs)
boost_http_io_setup_properties(boost_http_io_mrdocs PUBLIC BOOST_HTTP_IO_MRDOCS)
if (BOOST_BEAST2_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/beast2.hpp>\n")
add_library(boost_beast2_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
boost_beast2_setup_properties(boost_beast2_mrdocs)
boost_beast2_setup_properties(boost_beast2_mrdocs PUBLIC BOOST_BEAST2_MRDOCS)
return()
endif()

add_library(boost_http_io include/boost/http_io.hpp build/Jamfile ${BOOST_HTTP_IO_HEADERS} ${BOOST_HTTP_IO_SOURCES})
add_library(Boost::http_io ALIAS boost_http_io)
boost_http_io_setup_properties(boost_http_io)
add_library(boost_beast2 include/boost/beast2.hpp build/Jamfile ${BOOST_BEAST2_HEADERS} ${BOOST_BEAST2_SOURCES})
add_library(Boost::beast2 ALIAS boost_beast2)
boost_beast2_setup_properties(boost_beast2)

#-------------------------------------------------
#
# Tests
#
#-------------------------------------------------
if (BOOST_HTTP_IO_BUILD_TESTS)
if (BOOST_BEAST2_BUILD_TESTS)
add_subdirectory(test)
endif ()

Expand All @@ -184,6 +184,6 @@ endif ()
# Examples
#
#-------------------------------------------------
if (BOOST_HTTP_IO_BUILD_EXAMPLES)
if (BOOST_BEAST2_BUILD_EXAMPLES)
add_subdirectory(example)
endif ()
22 changes: 11 additions & 11 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@
|===

|Branch
|https://github.com/cppalliance/http_io/tree/master[`master`]
|https://github.com/cppalliance/http_io/tree/develop[`develop`]
|https://github.com/cppalliance/beast2/tree/master[`master`]
|https://github.com/cppalliance/beast2/tree/develop[`develop`]

|https://develop.http-io.cpp.al/[Docs]
|https://master.http-io.cpp.al/[image:https://img.shields.io/badge/docs-master-brightgreen.svg[Documentation]]
|https://develop.http-io.cpp.al/[image:https://img.shields.io/badge/docs-develop-brightgreen.svg[Documentation]]

|https://github.com/[GitHub Actions]
|https://github.com/cppalliance/http_io/actions/workflows/ci.yml?query=branch%3Amaster[image:https://github.com/cppalliance/http_io/actions/workflows/ci.yml/badge.svg?branch=master[CI]]
|https://github.com/cppalliance/http_io/actions/workflows/ci.yml?query=branch%3Adevelop[image:https://github.com/cppalliance/http_io/actions/workflows/ci.yml/badge.svg?branch=develop[CI]]
|https://github.com/cppalliance/beast2/actions/workflows/ci.yml?query=branch%3Amaster[image:https://github.com/cppalliance/beast2/actions/workflows/ci.yml/badge.svg?branch=master[CI]]
|https://github.com/cppalliance/beast2/actions/workflows/ci.yml?query=branch%3Adevelop[image:https://github.com/cppalliance/beast2/actions/workflows/ci.yml/badge.svg?branch=develop[CI]]


|https://drone.io/[Drone]
|https://drone.cpp.al/cppalliance/http_io/branches[image:https://drone.cpp.al/api/badges/cppalliance/http_io/status.svg?ref=refs/heads/master[Build Status]]
|https://drone.cpp.al/cppalliance/http_io/branches[image:https://drone.cpp.al/api/badges/cppalliance/http_io/status.svg?ref=refs/heads/develop[Build Status]]
|https://drone.cpp.al/cppalliance/beast2/branches[image:https://drone.cpp.al/api/badges/cppalliance/beast2/status.svg?ref=refs/heads/master[Build Status]]
|https://drone.cpp.al/cppalliance/beast2/branches[image:https://drone.cpp.al/api/badges/cppalliance/beast2/status.svg?ref=refs/heads/develop[Build Status]]

|https://codecov.io[Codecov]
|https://app.codecov.io/gh/cppalliance/http_io/tree/master[image:https://codecov.io/gh/cppalliance/http_io/branch/master/graph/badge.svg[codecov]]
|https://app.codecov.io/gh/cppalliance/http_io/tree/develop[image:https://codecov.io/gh/cppalliance/http_io/branch/develop/graph/badge.svg[codecov]]
|https://app.codecov.io/gh/cppalliance/beast2/tree/master[image:https://codecov.io/gh/cppalliance/beast2/branch/master/graph/badge.svg[codecov]]
|https://app.codecov.io/gh/cppalliance/beast2/tree/develop[image:https://codecov.io/gh/cppalliance/beast2/branch/develop/graph/badge.svg[codecov]]

|===

== boost.http_io
== boost.beast2

=== Visual Studio Solution

```cpp
cmake -G "Visual Studio 17 2022" -A win32 -B bin -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/Users/vinnie/src/boost/libs/http_io/cmake/toolchains/msvc.cmake"
cmake -G "Visual Studio 17 2022" -A x64 -B bin64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/Users/vinnie/src/boost/libs/http_io/cmake/toolchains/msvc.cmake"
cmake -G "Visual Studio 17 2022" -A win32 -B bin -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/Users/vinnie/src/boost/libs/beast2/cmake/toolchains/msvc.cmake"
cmake -G "Visual Studio 17 2022" -A x64 -B bin64 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="C:/Users/vinnie/src/boost/libs/beast2/cmake/toolchains/msvc.cmake"
```
24 changes: 12 additions & 12 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/CPPAlliance/http_io
# Official repository: https://github.com/cppalliance/beast2
#

import ../../config/checks/config : requires ;
Expand All @@ -19,38 +19,38 @@ constant c11-requires :
]
;

path-constant HTTP_IO_ROOT : .. ;
path-constant BEAST2_ROOT : .. ;

explicit
[ searched-lib ws2_32 : : <target-os>windows ] # NT
[ searched-lib mswsock : : <target-os>windows ] # NT
;

project boost/http_io
project boost/beast2
: common-requirements
$(c11-requires)
<link>shared:<define>BOOST_HTTP_IO_DYN_LINK=1
<link>static:<define>BOOST_HTTP_IO_STATIC_LINK=1
<link>shared:<define>BOOST_BEAST2_DYN_LINK=1
<link>static:<define>BOOST_BEAST2_STATIC_LINK=1
<target-os>windows:<define>_WIN32_WINNT=0x0601 # VFALCO?
<target-os>windows,<toolset>gcc:<library>ws2_32
<target-os>windows,<toolset>gcc:<library>mswsock
<target-os>windows,<toolset>gcc-cygwin:<define>__USE_W32_SOCKETS
: source-location $(HTTP_IO_ROOT)
: source-location $(BEAST2_ROOT)
;

alias http_io_sources : [ glob-tree-ex ./src : *.cpp ] ;
alias beast2_sources : [ glob-tree-ex ./src : *.cpp ] ;

explicit http_io_sources ;
explicit beast2_sources ;

lib boost_http_io
: http_io_sources
lib boost_beast2
: beast2_sources
: requirements
<library>/boost//http_proto
<library>/boost//url
<include>../
<define>BOOST_HTTP_IO_SOURCE
<define>BOOST_BEAST2_SOURCE
: usage-requirements
<library>/boost//http_proto
;

boost-install boost_http_io ;
boost-install boost_beast2 ;
4 changes: 2 additions & 2 deletions doc/antora.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: http_io
name: beast2
version: ~
title: Boost.Http.Io
title: Boost.Beast2
start_page: index.adoc
asciidoc:
attributes:
Expand Down
Loading
Loading