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
38 changes: 19 additions & 19 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_proto/
# Official repository: https://github.com/CPPAlliance/http/
#

name: CI
Expand Down Expand Up @@ -858,10 +858,10 @@ jobs:
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
ldd /__e/node20/bin/node

- name: Clone Boost.HTTP.Proto
- name: Clone Boost.HTTP
uses: actions/checkout@v3
with:
path: http-proto-root
path: http-root

- name: Clone Boost.Buffers
uses: actions/checkout@v3
Expand Down Expand Up @@ -904,11 +904,11 @@ jobs:
boost-dir: boost-source
modules-exclude-paths: ''
scan-modules-dir: |
http-proto-root
http-root
buffers-root
capy-root
scan-modules-ignore: |
http_proto
http
buffers
capy

Expand Down Expand Up @@ -978,7 +978,7 @@ jobs:
echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT

# Patch boost-root with workspace module
cp -r "$workspace_root"/http-proto-root "libs/$module"
cp -r "$workspace_root"/http-root "libs/$module"
cp -r "$workspace_root"/buffers-root libs/buffers
cp -r "$workspace_root"/capy-root libs/capy

Expand All @@ -989,7 +989,7 @@ jobs:
ASAN_OPTIONS: ${{ ((matrix.compiler == 'apple-clang' || matrix.compiler == 'clang') && 'detect_invalid_pointer_pairs=0:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1') || 'detect_invalid_pointer_pairs=2:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1' }}
with:
source-dir: boost-root
modules: http_proto
modules: http
toolset: ${{ matrix.b2-toolset }}
build-variant: ${{ matrix.build-type }}
cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx || '' }}
Expand Down Expand Up @@ -1029,7 +1029,7 @@ jobs:
export-compile-commands: ${{ matrix.time-trace }}
package: false
package-artifact: false
ref-source-dir: boost-root/libs/http_proto
ref-source-dir: boost-root/libs/http
toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}

- name: Set Path
Expand Down Expand Up @@ -1061,7 +1061,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_proto
# ref-source-dir: boost-root/libs/http
# trace-commands: true
# toolchain: ${{ (startsWith(matrix.runs-on, 'windows') && steps.patch-user-config.outputs.toolchain) || '' }}

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

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

Expand Down Expand Up @@ -1157,7 +1157,7 @@ jobs:
timeout-minutes: 120

steps:
- name: Clone Boost.HTTProto
- name: Clone Boost.HTTP
uses: actions/checkout@v3
with:
# Avoid the common API rate limit exceeded error in boostorg by including 100 latest commits in any case
Expand Down Expand Up @@ -1191,10 +1191,10 @@ jobs:
with:
apt-get: git cmake

- name: Clone Boost.Http.Proto
- name: Clone Boost.HTTP
uses: actions/checkout@v3
with:
path: http-proto-root
path: http-root

- name: Clone Boost.Buffers
uses: actions/checkout@v3
Expand All @@ -1218,11 +1218,11 @@ jobs:
boost-dir: boost-source
modules-exclude-paths: ''
scan-modules-dir: |
http-proto-root
http-root
buffers-root
capy-root
scan-modules-ignore: |
http_proto
http
buffers
capy

Expand Down Expand Up @@ -1256,7 +1256,7 @@ jobs:
echo -E "boost_root=$boost_root" >> $GITHUB_OUTPUT

# Patch boost-root with workspace module
cp -r "$workspace_root"/http-proto-root "libs/$module"
cp -r "$workspace_root"/http-root "libs/$module"
cp -r "$workspace_root"/buffers-root libs/buffers
cp -r "$workspace_root"/capy-root libs/capy

Expand All @@ -1276,7 +1276,7 @@ jobs:

BOOST_SRC_DIR="$(pwd)/boost-root"
export BOOST_SRC_DIR
cd boost-root/libs/http_proto
cd boost-root/libs/http

cd doc
bash ./build_antora.sh
Expand All @@ -1291,4 +1291,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: antora-docs-${{ matrix.name }}
path: boost-root/libs/http_proto/doc/build/site
path: boost-root/libs/http/doc/build/site
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ T default_value();
## Structure

* Boost.Beast2 refers to both the library which uses Boost.Asio and the collection of
libraries which includes Boost.Capy, Boost.Buffers, Boost.Http (http-proto), and Boost.Beast2
libraries which includes Boost.Capy, Boost.Buffers, Boost.Http (http), and Boost.Beast2

* Boost.Capy contains general purpose data structures and algorithms

Expand Down
89 changes: 44 additions & 45 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_proto
# Official repository: https://github.com/cppalliance/http
#

#-------------------------------------------------
Expand All @@ -16,14 +16,14 @@
#
#-------------------------------------------------
cmake_minimum_required(VERSION 3.8...3.20)
set(BOOST_HTTP_PROTO_VERSION 1)
set(BOOST_HTTP_VERSION 1)
if (BOOST_SUPERPROJECT_VERSION)
set(BOOST_HTTP_PROTO_VERSION ${BOOST_SUPERPROJECT_VERSION})
set(BOOST_HTTP_VERSION ${BOOST_SUPERPROJECT_VERSION})
endif ()
project(boost_http_proto VERSION "${BOOST_HTTP_PROTO_VERSION}" LANGUAGES CXX)
set(BOOST_HTTP_PROTO_IS_ROOT OFF)
project(boost_http VERSION "${BOOST_HTTP_VERSION}" LANGUAGES CXX)
set(BOOST_HTTP_IS_ROOT OFF)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(BOOST_HTTP_PROTO_IS_ROOT ON)
set(BOOST_HTTP_IS_ROOT ON)
endif ()
set(__ignore__ ${CMAKE_C_COMPILER})

Expand All @@ -32,12 +32,12 @@ set(__ignore__ ${CMAKE_C_COMPILER})
# Options
#
#-------------------------------------------------
if (BOOST_HTTP_PROTO_IS_ROOT)
if (BOOST_HTTP_IS_ROOT)
include(CTest)
endif ()
option(BOOST_HTTP_PROTO_BUILD_TESTS "Build boost::http_proto tests" ${BUILD_TESTING})
option(BOOST_HTTP_PROTO_BUILD_EXAMPLES "Build boost::http_proto examples" ${BOOST_HTTP_PROTO_IS_ROOT})
option(BOOST_HTTP_PROTO_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)
option(BOOST_HTTP_BUILD_TESTS "Build boost::http tests" ${BUILD_TESTING})
option(BOOST_HTTP_BUILD_EXAMPLES "Build boost::http examples" ${BOOST_HTTP_IS_ROOT})
option(BOOST_HTTP_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)

# Check if environment variable BOOST_SRC_DIR is set
if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR})
Expand All @@ -53,7 +53,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_PROTO_DEPENDENCIES
set(BOOST_HTTP_DEPENDENCIES
Boost::assert
Boost::buffers
Boost::capy
Expand All @@ -66,33 +66,32 @@ set(BOOST_HTTP_PROTO_DEPENDENCIES
Boost::throw_exception
Boost::type_traits
Boost::url
Boost::winapi
)
Boost::winapi)

foreach (BOOST_HTTP_PROTO_DEPENDENCY ${BOOST_HTTP_PROTO_DEPENDENCIES})
if (BOOST_HTTP_PROTO_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$")
list(APPEND BOOST_HTTP_PROTO_INCLUDE_LIBRARIES ${CMAKE_MATCH_1})
foreach (BOOST_HTTP_DEPENDENCY ${BOOST_HTTP_DEPENDENCIES})
if (BOOST_HTTP_DEPENDENCY MATCHES "^[ ]*Boost::([A-Za-z0-9_]+)[ ]*$")
list(APPEND BOOST_HTTP_INCLUDE_LIBRARIES ${CMAKE_MATCH_1})
endif ()
endforeach ()
# Conditional dependencies
if (NOT BOOST_URL_MRDOCS_BUILD)
if (BOOST_HTTP_PROTO_BUILD_TESTS)
set(BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES filesystem)
if (BOOST_HTTP_BUILD_TESTS)
set(BOOST_HTTP_UNIT_TEST_LIBRARIES filesystem)
endif ()
if (BOOST_HTTP_PROTO_BUILD_EXAMPLES)
# set(BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES json)
if (BOOST_HTTP_BUILD_EXAMPLES)
# set(BOOST_HTTP_EXAMPLE_LIBRARIES json)
endif ()
endif ()
# Complete dependency list
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_PROTO_INCLUDE_LIBRARIES} ${BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES http_proto)
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_INCLUDE_LIBRARIES} ${BOOST_HTTP_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES http)

#-------------------------------------------------
#
# Add Boost Subdirectory
#
#-------------------------------------------------
if (BOOST_HTTP_PROTO_IS_ROOT)
if (BOOST_HTTP_IS_ROOT)
set(CMAKE_FOLDER Dependencies)
# Find absolute BOOST_SRC_DIR
if (NOT IS_ABSOLUTE ${BOOST_SRC_DIR})
Expand Down Expand Up @@ -140,46 +139,46 @@ endif ()
#-------------------------------------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

file(GLOB_RECURSE BOOST_HTTP_PROTO_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp include/boost/*.natvis)
file(GLOB_RECURSE BOOST_HTTP_PROTO_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)
file(GLOB_RECURSE BOOST_HTTP_HEADERS CONFIGURE_DEPENDS include/boost/*.hpp include/boost/*.natvis)
file(GLOB_RECURSE BOOST_HTTP_SOURCES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)

source_group("" FILES "include/boost/http_proto.hpp" "build/Jamfile")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http_proto PREFIX "include" FILES ${BOOST_HTTP_PROTO_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_PROTO_SOURCES})
source_group("" FILES "include/boost/http.hpp" "build/Jamfile")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http PREFIX "include" FILES ${BOOST_HTTP_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_SOURCES})

function(boost_http_proto_setup_properties target)
function(boost_http_setup_properties target)
target_compile_features(${target} PUBLIC cxx_constexpr)
target_include_directories(${target} PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}")
target_link_libraries(${target} PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES})
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_NO_LIB)
target_compile_definitions(${target} PRIVATE BOOST_HTTP_PROTO_SOURCE)
target_link_libraries(${target} PUBLIC ${BOOST_HTTP_DEPENDENCIES})
target_compile_definitions(${target} PUBLIC BOOST_HTTP_NO_LIB)
target_compile_definitions(${target} PRIVATE BOOST_HTTP_SOURCE)
if (BUILD_SHARED_LIBS)
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_DYN_LINK)
target_compile_definitions(${target} PUBLIC BOOST_HTTP_DYN_LINK)
else ()
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_STATIC_LINK)
target_compile_definitions(${target} PUBLIC BOOST_HTTP_STATIC_LINK)
endif ()
endfunction()

if (BOOST_HTTP_PROTO_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/http_proto.hpp>\n")
add_library(boost_http_proto_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
boost_http_proto_setup_properties(boost_http_proto_mrdocs)
target_compile_definitions(boost_http_proto_mrdocs PUBLIC BOOST_HTTP_PROTO_MRDOCS)
set_target_properties(boost_http_proto_mrdocs PROPERTIES EXPORT_COMPILE_COMMANDS ON)
if (BOOST_HTTP_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/http.hpp>\n")
add_library(boost_http_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
boost_http_setup_properties(boost_http_mrdocs)
target_compile_definitions(boost_http_mrdocs PUBLIC BOOST_HTTP_MRDOCS)
set_target_properties(boost_http_mrdocs PROPERTIES EXPORT_COMPILE_COMMANDS ON)
return()
endif ()

add_library(boost_http_proto include/boost/http_proto.hpp build/Jamfile ${BOOST_HTTP_PROTO_HEADERS} ${BOOST_HTTP_PROTO_SOURCES})
add_library(Boost::http_proto ALIAS boost_http_proto)
boost_http_proto_setup_properties(boost_http_proto)
add_library(boost_http include/boost/http.hpp build/Jamfile ${BOOST_HTTP_HEADERS} ${BOOST_HTTP_SOURCES})
add_library(Boost::http ALIAS boost_http)
boost_http_setup_properties(boost_http)

#-------------------------------------------------
#
# Tests
#
#-------------------------------------------------
if (BOOST_HTTP_PROTO_BUILD_TESTS)
if (BOOST_HTTP_BUILD_TESTS)
add_subdirectory(test)
endif ()

Expand All @@ -188,6 +187,6 @@ endif ()
# Examples
#
#-------------------------------------------------
if (BOOST_HTTP_PROTO_BUILD_EXAMPLES)
if (BOOST_HTTP_BUILD_EXAMPLES)
# add_subdirectory(example)
endif ()
Loading
Loading