Skip to content

Commit 71b75fc

Browse files
committed
Cleanup Boost.Beast detection and handling when missing
1 parent 22dad2c commit 71b75fc

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ endif()
3434
option(GRAPHQL_BUILD_SCHEMAGEN "Build the schemagen tool." ON)
3535
option(GRAPHQL_BUILD_CLIENTGEN "Build the clientgen tool." ON)
3636
option(GRAPHQL_BUILD_TESTS "Build the tests and sample schema library." ON)
37-
option(GRAPHQL_BUILD_HTTP_SAMPLE "Build the HTTP client sample using C++20 coroutines with Boost.Beast/Boost.Asio." OFF)
3837

3938
if(GRAPHQL_BUILD_SCHEMAGEN)
4039
list(APPEND VCPKG_MANIFEST_FEATURES "schemagen")
@@ -48,18 +47,21 @@ if(GRAPHQL_BUILD_TESTS)
4847
list(APPEND VCPKG_MANIFEST_FEATURES "tests")
4948
endif()
5049

51-
if(GRAPHQL_BUILD_HTTP_SAMPLE)
52-
list(APPEND VCPKG_MANIFEST_FEATURES "http-sample")
53-
endif()
54-
5550
if(GRAPHQL_BUILD_SCHEMAGEN AND GRAPHQL_BUILD_CLIENTGEN)
5651
option(GRAPHQL_UPDATE_SAMPLES "Regenerate the sample schema sources whether or not we're building the tests." ON)
5752

5853
if(GRAPHQL_UPDATE_SAMPLES)
5954
list(APPEND VCPKG_MANIFEST_FEATURES "update-samples")
55+
56+
option(GRAPHQL_BUILD_HTTP_SAMPLE "Build the HTTP client sample using C++20 coroutines with Boost.Beast/Boost.Asio." ON)
57+
58+
if(GRAPHQL_BUILD_HTTP_SAMPLE)
59+
list(APPEND VCPKG_MANIFEST_FEATURES "http-sample")
60+
endif()
6061
endif()
6162
else()
6263
set(GRAPHQL_UPDATE_SAMPLES OFF CACHE BOOL "Disable regenerating samples." FORCE)
64+
set(GRAPHQL_BUILD_HTTP_SAMPLE OFF CACHE BOOL "Disable regenerating samples." FORCE)
6365
endif()
6466

6567
project(cppgraphqlgen VERSION ${LATEST_VERSION})

samples/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ add_subdirectory(today)
99
add_subdirectory(validation)
1010

1111
if(GRAPHQL_BUILD_HTTP_SAMPLE)
12-
find_package(Boost)
13-
if(Boost_FOUND)
12+
if(EXISTS "${Boost_INCLUDE_DIR}/boost/beast.hpp")
1413
add_subdirectory(proxy)
14+
else()
15+
message(WARNING "GRAPHQL_BUILD_HTTP_SAMPLE requires the Boost.Beast header-only library. Not found in ${Boost_INCLUDE_DIR}.")
1516
endif()
1617
endif()

0 commit comments

Comments
 (0)