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: 33 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ jobs:
apt-get: >-
${{ matrix.install }}
build-essential
${{ matrix.x86 && '' || '' }}
zlib1g-dev libbrotli-dev
${{ matrix.x86 && 'zlib1g-dev:i386 libbrotli-dev:i386' || '' }}

- name: Clone Capy
uses: actions/checkout@v4
Expand All @@ -299,6 +300,13 @@ jobs:
ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
path: capy-root

- name: Clone Corosio
uses: actions/checkout@v4
with:
repository: cppalliance/corosio
ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
path: corosio-root

- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.9.0
id: boost-clone
Expand All @@ -307,7 +315,7 @@ jobs:
boost-dir: boost-source
modules-exclude-paths: ''
scan-modules-dir: http-root
scan-modules-ignore: http,capy
scan-modules-ignore: http,capy,corosio

- name: ASLR Fix
if: ${{ startsWith(matrix.runs-on, 'ubuntu' )}}
Expand All @@ -334,6 +342,7 @@ jobs:
# Remove module from boost-source
rm -r "boost-source/libs/$module" || true
rm -r "boost-source/libs/capy" || true
rm -r "boost-source/libs/corosio" || true

# Copy cached boost-source to an isolated boost-root
cp -r boost-source boost-root
Expand All @@ -350,6 +359,9 @@ jobs:
# Patch boost-root with capy dependency
cp -r "$workspace_root"/capy-root "libs/capy"

# Patch boost-root with corosio dependency
cp -r "$workspace_root"/corosio-root "libs/corosio"

- name: Boost B2 Workflow
uses: alandefreitas/cpp-actions/b2-workflow@v1.9.0
if: ${{ !matrix.coverage }}
Expand Down Expand Up @@ -381,6 +393,7 @@ jobs:
build-type: ${{ matrix.build-type }}
build-target: tests
run-tests: true
install: true
install-prefix: .local
cxxstd: ${{ matrix.latest-cxxstd }}
cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }}
Expand All @@ -405,9 +418,13 @@ jobs:
run: |
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/.local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV"

# Disabled: Boost's CMake infrastructure does not generate install rules for
# the "main" library in BOOST_INCLUDE_LIBRARIES, only for its dependencies.
# This causes find_package(Boost COMPONENTS http) to fail because
# boost_httpConfig.cmake is never installed.
- name: Find Package Integration Workflow
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0
if: ${{ matrix.build-cmake || matrix.is-earliest }}
if: false # ${{ matrix.build-cmake || matrix.is-earliest }}
with:
source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test
build-dir: __build_cmake_install_test__
Expand Down Expand Up @@ -541,7 +558,7 @@ jobs:
with:
apt-get: git cmake

- name: Clone Boost.Corosio
- name: Clone Boost.Http
uses: actions/checkout@v4
with:
path: http-root
Expand All @@ -553,6 +570,13 @@ jobs:
ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
path: capy-root

- name: Clone Corosio
uses: actions/checkout@v4
with:
repository: cppalliance/corosio
ref: ${{ (github.ref_name == 'master' && github.ref_name) || 'develop' }}
path: corosio-root

- name: Clone Boost
uses: alandefreitas/cpp-actions/boost-clone@v1.9.0
id: boost-clone
Expand All @@ -561,7 +585,7 @@ jobs:
boost-dir: boost-source
modules-exclude-paths: ''
scan-modules-dir: http-root
scan-modules-ignore: http,capy
scan-modules-ignore: http,capy,corosio

- name: Patch Boost
id: patch
Expand All @@ -583,6 +607,7 @@ jobs:
# Remove module from boost-source
rm -r "boost-source/libs/$module" || true
rm -r "boost-source/libs/capy" || true
rm -r "boost-source/libs/corosio" || true

# Copy cached boost-source to an isolated boost-root
cp -r boost-source boost-root
Expand All @@ -599,6 +624,9 @@ jobs:
# Patch boost-root with capy dependency
cp -r "$workspace_root"/capy-root "libs/capy"

# Patch boost-root with corosio dependency
cp -r "$workspace_root"/corosio-root "libs/corosio"

- uses: actions/setup-node@v4
with:
node-version: 18
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/.vscode/
/.cache/
/.clangd
/build/*
!/build/Jamfile
!/build/brotli.jam
/out/
CMakeUserPresets.json
/CMakeUserPresets.json
/tmpclaude-*-cwd

# CMake artifacts (if accidentally run from source dir)
#CMakeCache.txt
Expand Down
57 changes: 51 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ set(BOOST_HTTP_DEPENDENCIES
Boost::capy
Boost::config
Boost::core
Boost::corosio
Boost::json
Boost::mp11
Boost::static_assert
Expand All @@ -68,23 +67,32 @@ set(BOOST_HTTP_DEPENDENCIES
Boost::url
Boost::winapi)

# corosio is used header-only (only io_buffer_param.hpp)
# We include it separately to avoid linking against the full library
set(BOOST_HTTP_HEADER_ONLY_DEPENDENCIES corosio)

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 ()
# Add header-only dependencies to include list (but not link list)
list(APPEND BOOST_HTTP_INCLUDE_LIBRARIES ${BOOST_HTTP_HEADER_ONLY_DEPENDENCIES})
# Conditional dependencies
if (NOT BOOST_URL_MRDOCS_BUILD)
if (NOT BOOST_HTTP_MRDOCS_BUILD)
if (BOOST_HTTP_BUILD_TESTS)
set(BOOST_HTTP_UNIT_TEST_LIBRARIES filesystem)
set(BOOST_HTTP_UNIT_TEST_LIBRARIES asio filesystem)
endif ()
if (BOOST_HTTP_BUILD_EXAMPLES)
# set(BOOST_HTTP_EXAMPLE_LIBRARIES json)
endif ()
endif ()
# Complete dependency list
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_INCLUDE_LIBRARIES} ${BOOST_HTTP_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES http)
# Complete dependency list (only set when http is the root project)
# When built as part of the superproject, these are set by the superproject
if (BOOST_HTTP_IS_ROOT)
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_INCLUDE_LIBRARIES} ${BOOST_HTTP_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_EXAMPLE_LIBRARIES})
set(BOOST_EXCLUDE_LIBRARIES http)
endif()

#-------------------------------------------------
#
Expand Down Expand Up @@ -151,6 +159,10 @@ function(boost_http_setup_properties target)
target_include_directories(${target} PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}")
target_link_libraries(${target} PUBLIC ${BOOST_HTTP_DEPENDENCIES})
# Add corosio headers without linking (header-only usage)
# BUILD_INTERFACE: only during build (installed headers are in standard Boost include path)
target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/../corosio/include>)
target_compile_definitions(${target} PUBLIC BOOST_COROSIO_NO_LIB) # Disable corosio auto-linking
Comment on lines +162 to +165
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hardcoded sibling path may break standalone builds.

The path ${PROJECT_SOURCE_DIR}/../corosio/include assumes corosio is always a sibling directory. This works in Boost super-project builds but may fail for users building http standalone (e.g., via find_package).

Consider guarding this with a check for the directory's existence or using find_path as a fallback:

Suggested improvement
-    # Add corosio headers without linking (header-only usage)
-    # BUILD_INTERFACE: only during build (installed headers are in standard Boost include path)
-    target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/../corosio/include>)
+    # Add corosio headers without linking (header-only usage)
+    # BUILD_INTERFACE: only during build (installed headers are in standard Boost include path)
+    set(COROSIO_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/../corosio/include")
+    if (EXISTS "${COROSIO_INCLUDE_DIR}")
+        target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${COROSIO_INCLUDE_DIR}>)
+    endif ()
🤖 Prompt for AI Agents
In `@CMakeLists.txt` around lines 159 - 162, The hardcoded sibling include path
using PROJECT_SOURCE_DIR in the target_include_directories call is brittle;
modify the CMake logic to first check for that directory's existence (e.g.,
using if(EXISTS ${PROJECT_SOURCE_DIR}/../corosio/include)) and only add the
BUILD_INTERFACE include when present, otherwise fall back to a find_path lookup
(e.g., find_path to populate a COROSIO_INCLUDE_DIR) and add that result if
found; keep the target_compile_definitions(… BOOST_COROSIO_NO_LIB) behavior but
conditionally add the include only when a valid corosio include directory is
discovered so standalone http builds via find_package won't break.

target_compile_definitions(${target} PUBLIC BOOST_HTTP_NO_LIB)
target_compile_definitions(${target} PRIVATE BOOST_HTTP_SOURCE)
if (BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -180,6 +192,39 @@ elseif (APPLE)
target_link_libraries(boost_http PRIVATE "-framework Security")
endif ()

# Zlib
find_package(ZLIB)
if (ZLIB_FOUND)
file(GLOB_RECURSE BOOST_HTTP_ZLIB_HEADERS CONFIGURE_DEPENDS include/boost/http/zlib/*.hpp)
file(GLOB_RECURSE BOOST_HTTP_ZLIB_SOURCES CONFIGURE_DEPENDS src_zlib/*.cpp src_zlib/*.hpp)
source_group("" FILES "include/boost/http/zlib.hpp")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http/zlib PREFIX "include" FILES ${BOOST_HTTP_ZLIB_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src_zlib PREFIX "src" FILES ${BOOST_HTTP_ZLIB_SOURCES})
add_library(boost_http_zlib include/boost/http/zlib.hpp build/Jamfile ${BOOST_HTTP_ZLIB_HEADERS} ${BOOST_HTTP_ZLIB_SOURCES})
add_library(Boost::http_zlib ALIAS boost_http_zlib)
target_link_libraries(boost_http_zlib PUBLIC boost_http)
target_link_libraries(boost_http_zlib PRIVATE ZLIB::ZLIB)
target_compile_definitions(boost_http_zlib PUBLIC BOOST_HTTP_HAS_ZLIB)
target_compile_definitions(boost_http_zlib PRIVATE BOOST_HTTP_SOURCE)
endif ()
Comment on lines +195 to +209
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

fd -t f "\.hpp$" include/ | grep -i zlib | head -20

Repository: cppalliance/http

Length of output: 176


🏁 Script executed:

cd /tmp && find . -name "CMakeLists.txt" -type f 2>/dev/null | head -1 | xargs cat > /dev/null 2>&1; echo "ready"

Repository: cppalliance/http

Length of output: 65


🏁 Script executed:

# Get the full CMakeLists.txt to understand the project structure
wc -l CMakeLists.txt

Repository: cppalliance/http

Length of output: 78


🏁 Script executed:

# Check the boost_http target setup
sed -n '1,189p' CMakeLists.txt | tail -50

Repository: cppalliance/http

Length of output: 2337


🏁 Script executed:

# Check the complete ZLIB section and surrounding context
sed -n '180,210p' CMakeLists.txt

Repository: cppalliance/http

Length of output: 1546


🏁 Script executed:

sed -n '204,240p' CMakeLists.txt

Repository: cppalliance/http

Length of output: 1575


Add target_include_directories and target_compile_features to boost_http_zlib target.

The boost_http_zlib target is missing the explicit configuration applied to boost_http. Add the following to ensure proper compilation:

target_compile_features(boost_http_zlib PUBLIC cxx_constexpr)
target_include_directories(boost_http_zlib PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(boost_http_zlib PRIVATE "${PROJECT_SOURCE_DIR}")

This matches the setup in the boost_http_setup_properties() helper function (used for the main target) and should also be applied to boost_http_brotli for consistency.

🤖 Prompt for AI Agents
In `@CMakeLists.txt` around lines 190 - 204, The boost_http_zlib target lacks the
same include directories and compile feature settings as boost_http; update the
boost_http_zlib target (and likewise boost_http_brotli) to mirror
boost_http_setup_properties by adding target_compile_features(boost_http_zlib
PUBLIC cxx_constexpr) and target_include_directories(boost_http_zlib PUBLIC
"${PROJECT_SOURCE_DIR}/include" PRIVATE "${PROJECT_SOURCE_DIR}"), ensuring the
same PUBLIC/PRIVATE visibility and matching the settings applied to the
boost_http target.


# Brotli
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Brotli)
if (Brotli_FOUND)
file(GLOB_RECURSE BOOST_HTTP_BROTLI_HEADERS CONFIGURE_DEPENDS include/boost/http/brotli/*.hpp)
file(GLOB_RECURSE BOOST_HTTP_BROTLI_SOURCES CONFIGURE_DEPENDS src_brotli/*.cpp src_brotli/*.hpp)
source_group("" FILES "include/boost/http/brotli.hpp")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http/brotli PREFIX "include" FILES ${BOOST_HTTP_BROTLI_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src_brotli PREFIX "src" FILES ${BOOST_HTTP_BROTLI_SOURCES})
add_library(boost_http_brotli include/boost/http/brotli.hpp build/Jamfile ${BOOST_HTTP_BROTLI_HEADERS} ${BOOST_HTTP_BROTLI_SOURCES})
add_library(Boost::http_brotli ALIAS boost_http_brotli)
target_link_libraries(boost_http_brotli PUBLIC boost_http)
target_link_libraries(boost_http_brotli PRIVATE Brotli::common Brotli::decoder Brotli::encoder)
target_compile_definitions(boost_http_brotli PUBLIC BOOST_HTTP_HAS_BROTLI)
target_compile_definitions(boost_http_brotli PRIVATE BOOST_HTTP_SOURCE)
endif ()
Comment on lines +195 to +226
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "CMakeLists.txt" -type f | head -20

Repository: cppalliance/http

Length of output: 187


🏁 Script executed:

cat -n CMakeLists.txt | sed -n '183,214p'

Repository: cppalliance/http

Length of output: 2407


🏁 Script executed:

# Check if boost_http_zlib/brotli are exported or installed
rg -n "boost_http_zlib|boost_http_brotli" CMakeLists.txt | head -30

Repository: cppalliance/http

Length of output: 1079


🏁 Script executed:

# Check if these targets are exported or installed
rg -n "TARGETS.*boost_http_zlib|TARGETS.*boost_http_brotli|install" CMakeLists.txt | tail -40

Repository: cppalliance/http

Length of output: 42


🏁 Script executed:

wc -l CMakeLists.txt

Repository: cppalliance/http

Length of output: 78


🏁 Script executed:

cat -n CMakeLists.txt | sed -n '215,232p'

Repository: cppalliance/http

Length of output: 554


🏁 Script executed:

cat -n CMakeLists.txt | sed -n '1,100p'

Repository: cppalliance/http

Length of output: 4000


🏁 Script executed:

cat -n CMakeLists.txt | sed -n '100,182p'

Repository: cppalliance/http

Length of output: 4179


🏁 Script executed:

# Search for usage of boost_http_zlib and boost_http_brotli in tests
rg -r "boost_http_zlib|boost_http_brotli|Boost::http_zlib|Boost::http_brotli" test/

Repository: cppalliance/http

Length of output: 223


🏁 Script executed:

# Check if these libraries are linked in test CMakeLists files
rg -n "boost_http_zlib|boost_http_brotli|Boost::http_zlib|Boost::http_brotli" test/CMakeLists.txt test/unit/CMakeLists.txt test/limits/CMakeLists.txt

Repository: cppalliance/http

Length of output: 371


🏁 Script executed:

# Check if boost_http includes zlib/brotli headers directly
rg "include.*zlib|include.*brotli" include/boost/http.hpp include/boost/http/

Repository: cppalliance/http

Length of output: 1825


🏁 Script executed:

# Check if boost_http.hpp or main boost_http headers include zlib/brotli
cat include/boost/http.hpp

Repository: cppalliance/http

Length of output: 1828


🏁 Script executed:

# Check if there are CMake config/package files that export these libraries
find . -name "*Config.cmake" -o -name "*config.cmake" -o -name "*.pc"

Repository: cppalliance/http

Length of output: 42


🏁 Script executed:

# Check all source files to see if zlib/brotli are used in boost_http core
rg "ZLIB|Brotli|zlib|brotli" src/ include/boost/http/ --exclude="*zlib*" --exclude="*brotli*"

Repository: cppalliance/http

Length of output: 471


🏁 Script executed:

# Check all source files to see if zlib/brotli are used in boost_http core
rg "ZLIB|Brotli" src/ include/boost/http/ -g "!*zlib*" -g "!*brotli*"

Repository: cppalliance/http

Length of output: 623


🏁 Script executed:

# Check the library types (static vs shared) in CMakeLists.txt
rg -n "add_library" CMakeLists.txt

Repository: cppalliance/http

Length of output: 778


Make compression library dependencies PUBLIC for proper static linking.

boost_http_zlib and boost_http_brotli link their external dependencies as PRIVATE. In static builds, when consumers link these wrapper libraries, they won't automatically receive the necessary linker flags for ZLIB or Brotli, potentially causing unresolved symbol errors if the implementation calls functions from these libraries.

Change to:

target_link_libraries(boost_http_zlib PUBLIC boost_http ZLIB::ZLIB)
target_link_libraries(boost_http_brotli PUBLIC boost_http Brotli::common Brotli::decoder Brotli::encoder)

This ensures proper dependency propagation in static builds and matches CMake best practices for library packaging.

🤖 Prompt for AI Agents
In `@CMakeLists.txt` around lines 183 - 214, The CMake rules currently link ZLIB
and Brotli as PRIVATE to boost_http_zlib and boost_http_brotli, which prevents
consumers from inheriting those linker dependencies; update the two
target_link_libraries calls so dependencies are PUBLIC: change
target_link_libraries(boost_http_zlib PRIVATE ZLIB::ZLIB) to
target_link_libraries(boost_http_zlib PUBLIC ZLIB::ZLIB) and change
target_link_libraries(boost_http_brotli PRIVATE Brotli::common Brotli::decoder
Brotli::encoder) to target_link_libraries(boost_http_brotli PUBLIC
Brotli::common Brotli::decoder Brotli::encoder) so that consumers of
Boost::http_zlib and Boost::http_brotli receive the necessary linker flags for
static linking.

Comment on lines +211 to +226
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if brotli headers are in the main include path or a separate directory
fd -t f "\.hpp$" -p "brotli" include/

Repository: cppalliance/http

Length of output: 3419


🏁 Script executed:

# Check CMakeLists.txt for zlib configuration to see the pattern
rg -A 10 -B 2 "zlib" CMakeLists.txt | head -60

Repository: cppalliance/http

Length of output: 1542


🏁 Script executed:

# Look for any target_include_directories calls in the entire CMakeLists.txt
rg "target_include_directories" CMakeLists.txt -A 2

Repository: cppalliance/http

Length of output: 595


🏁 Script executed:

# Get more context around where target_include_directories is called
rg "target_include_directories" CMakeLists.txt -B 10 | head -80

Repository: cppalliance/http

Length of output: 1010


🏁 Script executed:

# Check if there's a function or foreach loop that applies to all targets
rg "foreach|function|macro" CMakeLists.txt | head -20

Repository: cppalliance/http

Length of output: 381


🏁 Script executed:

# Look at the complete zlib and brotli section to see full context
sed -n '184,230p' CMakeLists.txt

Repository: cppalliance/http

Length of output: 2519


🏁 Script executed:

# Look for where boost_http_setup_properties is called
rg "boost_http_setup_properties" CMakeLists.txt

Repository: cppalliance/http

Length of output: 195


🏁 Script executed:

# Get context around the main boost_http library creation
sed -n '160,190p' CMakeLists.txt

Repository: cppalliance/http

Length of output: 1345


🏁 Script executed:

# Check the full CMakeLists.txt for main boost_http target setup
rg -B 5 "add_library\(boost_http" CMakeLists.txt | head -40

Repository: cppalliance/http

Length of output: 1816


Add explicit property setup for boost_http_brotli (and boost_http_zlib) targets.

Both boost_http_brotli and boost_http_zlib should call boost_http_setup_properties() immediately after their add_library() call, just like the main boost_http target does. This ensures they have explicit public include directories, compile features, and definitions properly configured rather than relying solely on inheritance through target_link_libraries(... PUBLIC boost_http).

Example fix for brotli (apply same pattern to zlib)
add_library(boost_http_brotli include/boost/http/brotli.hpp build/Jamfile ${BOOST_HTTP_BROTLI_HEADERS} ${BOOST_HTTP_BROTLI_SOURCES})
add_library(Boost::http_brotli ALIAS boost_http_brotli)
boost_http_setup_properties(boost_http_brotli)
target_link_libraries(boost_http_brotli PUBLIC boost_http)
🤖 Prompt for AI Agents
In `@CMakeLists.txt` around lines 206 - 221, The brotli and zlib subtargets need
explicit property setup: after the add_library(...) for boost_http_brotli and
boost_http_zlib, call boost_http_setup_properties(<target>) before linking to
boost_http so the public include dirs, compile features and definitions are
applied directly to those targets; locate the add_library lines for
boost_http_brotli and boost_http_zlib and insert
boost_http_setup_properties(boost_http_brotli) and
boost_http_setup_properties(boost_http_zlib) immediately after their respective
add_library(...) calls and before target_link_libraries(... PUBLIC boost_http).


#-------------------------------------------------
#
# Tests
Expand Down
43 changes: 40 additions & 3 deletions build/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# Official repository: https://github.com/vinniefalco/http
#

import ac ;
import ../../config/checks/config : requires ;

constant c11-requires :
Expand Down Expand Up @@ -43,20 +44,56 @@ lib boost_http
: http_sources
: requirements
<library>/boost//capy
<library>/boost/corosio//boost_corosio
<library>/boost/json//boost_json/<warnings-as-errors>off
<library>/boost//url
<include>../
<include>../../corosio/include
<define>BOOST_HTTP_SOURCE
<define>BOOST_COROSIO_NO_LIB
<target-os>windows:<library>bcrypt_sys
<target-os>darwin:<linkflags>"-framework Security"
: usage-requirements
<library>/boost//capy
<library>/boost/corosio//boost_corosio
<library>/boost/json//boost_json/<warnings-as-errors>off
<library>/boost//url
<include>../../corosio/include
<define>BOOST_COROSIO_NO_LIB
<target-os>windows:<library>bcrypt_sys
<target-os>darwin:<linkflags>"-framework Security"
;

boost-install boost_http ;
# Zlib
using zlib ;

alias http_zlib_sources : [ glob-tree-ex src_zlib : *.cpp ] ;

lib boost_http_zlib
: http_zlib_sources
: requirements
<library>/boost/http//boost_http
<define>BOOST_HTTP_SOURCE
[ ac.check-library /zlib//zlib : <library>/zlib//zlib : <build>no ]
: usage-requirements
<library>/boost/http//boost_http
<define>BOOST_HTTP_HAS_ZLIB
;

# Brotli
using brotli ;

alias http_brotli_sources : [ glob-tree-ex src_brotli : *.cpp ] ;

lib boost_http_brotli
: http_brotli_sources
: requirements
<library>/boost/http//boost_http
<define>BOOST_HTTP_SOURCE
[ ac.check-library /brotli//brotlicommon : <library>/brotli//brotlicommon : <build>no ]
[ ac.check-library /brotli//brotlidec : <library>/brotli//brotlidec : <build>no ]
[ ac.check-library /brotli//brotlienc : <library>/brotli//brotlienc : <build>no ]
: usage-requirements
<library>/boost/http//boost_http
<define>BOOST_HTTP_HAS_BROTLI
;

boost-install boost_http boost_http_zlib boost_http_brotli ;
Loading
Loading