Skip to content

Commit

Permalink
Merge pull request #25 from 5cript/feat/boost_1_86_update
Browse files Browse the repository at this point in the history
Updated code for new asio.
  • Loading branch information
5cript authored Sep 19, 2024
2 parents 4ac9a87 + e43cb65 commit 2781a88
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} -G"Ninja" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_FLAGS="-stdlib=libc++" -DROAR_BUILD_TESTS=on -DCMAKE_CXX_EXTENSIONS=on -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_LINKER=lld -DCMAKE_CXX_STANDARD=20
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build
run: cmake --build ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
-DCMAKE_C_COMPILER=cc
-DCMAKE_CXX_STANDARD=20
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Build
run: cmake --build ${{github.workspace}}/build/clang_${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
Expand Down
1 change: 1 addition & 0 deletions include/roar/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <boost/beast/http/field.hpp>
#include <boost/beast/http/write.hpp>
#include <boost/beast/http/read.hpp>
#include <boost/beast/core/flat_buffer.hpp>
#include <boost/beast/ssl/ssl_stream.hpp>
#include <boost/beast/core/tcp_stream.hpp>
#include <boost/asio/ip/tcp.hpp>
Expand Down
6 changes: 3 additions & 3 deletions include/roar/routing/proto_route.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ namespace Roar
struct RouteOptions
{
/// If the server is an https server, setting this to true will allow unencrypted requests on this route.
bool allowUnsecure;
bool allowUnsecure = false;

/// Set this to true if you expect a websocket upgrade request on this route.
bool expectUpgrade;
bool expectUpgrade = false;

/// Set this to provide automatically generated cors headers and preflight requests.
std::optional<CorsSettings> cors;
std::optional<CorsSettings> cors = std::nullopt;
};

namespace Detail
Expand Down
7 changes: 6 additions & 1 deletion src/roar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ set_target_warnings(roar)

if(${ROAR_ENABLE_NLOHMANN_JSON})
target_link_libraries(roar PUBLIC nlohmann_json::nlohmann_json)
target_compile_definitions(roar PUBLIC ROAR_ENABLE_NLOHMANN_JSON=1 BOOST_ASIO_DISABLE_CONCEPTS)
target_compile_definitions(roar PUBLIC ROAR_ENABLE_NLOHMANN_JSON=1)
endif()

if (${Boost_VERSION_MAJOR} GREATER_EQUAL 1 AND ${Boost_VERSION_MINOR} GREATER_EQUAL 84)
else()
target_compile_definitions(roar PUBLIC BOOST_ASIO_DISABLE_CONCEPTS=1)
endif()

if(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/roar/websocket/websocket_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ namespace Roar
endpointIterator,
[self = shared_from_this(),
timeout = std::move(connectParameters.timeout),
host = connectParameters.host](auto ec, auto const& endpoint) {
host = connectParameters.host](auto ec, boost::asio::ip::tcp::resolver::results_type::endpoint_type const& endpoint) {
self->impl_->onConnect(ec, endpoint, timeout, std::move(host), self);
});
},
Expand Down

0 comments on commit 2781a88

Please sign in to comment.