Skip to content

Commit

Permalink
Merge pull request #92 from boostorg/90-add-support-for-reconnection
Browse files Browse the repository at this point in the history
90 add support for reconnection
  • Loading branch information
mzimbres authored May 6, 2023
2 parents e7ff1ce + a6cb4ca commit 2d53bb7
Show file tree
Hide file tree
Showing 60 changed files with 2,856 additions and 1,859 deletions.
53 changes: 37 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ include_directories(include)
# Main function for the examples.
#=======================================================================

add_library(test_common STATIC
tests/common.cpp
)
target_compile_features(test_common PUBLIC cxx_std_17)
if (MSVC)
target_compile_options(test_common PRIVATE /bigobj)
target_compile_definitions(test_common PRIVATE _WIN32_WINNT=0x0601)
endif()

#=======================================================================

add_library(common STATIC
examples/start.cpp
examples/main.cpp
Expand All @@ -81,15 +92,6 @@ if (MSVC)
target_compile_definitions(cpp20_intro PRIVATE _WIN32_WINNT=0x0601)
endif()

add_executable(cpp20_intro_awaitable_ops examples/cpp20_intro_awaitable_ops.cpp)
target_link_libraries(cpp20_intro_awaitable_ops common)
target_compile_features(cpp20_intro_awaitable_ops PUBLIC cxx_std_20)
add_test(cpp20_intro_awaitable_ops cpp20_intro_awaitable_ops)
if (MSVC)
target_compile_options(cpp20_intro_awaitable_ops PRIVATE /bigobj)
target_compile_definitions(cpp20_intro_awaitable_ops PRIVATE _WIN32_WINNT=0x0601)
endif()

add_executable(cpp17_intro examples/cpp17_intro.cpp)
target_compile_features(cpp17_intro PUBLIC cxx_std_17)
add_test(cpp17_intro cpp17_intro)
Expand Down Expand Up @@ -156,10 +158,12 @@ if (Protobuf_FOUND)
endif()
endif()

if (NOT MSVC)
add_executable(cpp20_subscriber examples/cpp20_subscriber.cpp)
target_compile_features(cpp20_subscriber PUBLIC cxx_std_20)
target_link_libraries(cpp20_subscriber common)
if (MSVC)
target_compile_options(cpp20_subscriber PRIVATE /bigobj)
target_compile_definitions(cpp20_subscriber PRIVATE _WIN32_WINNT=0x0601)
endif()

add_executable(cpp20_intro_tls examples/cpp20_intro_tls.cpp)
Expand Down Expand Up @@ -205,6 +209,7 @@ endif()

add_executable(test_conn_exec tests/conn_exec.cpp)
target_compile_features(test_conn_exec PUBLIC cxx_std_20)
target_link_libraries(test_conn_exec test_common)
add_test(test_conn_exec test_conn_exec)
if (MSVC)
target_compile_options(test_conn_exec PRIVATE /bigobj)
Expand All @@ -213,6 +218,7 @@ endif()

add_executable(test_conn_exec_retry tests/conn_exec_retry.cpp)
target_compile_features(test_conn_exec_retry PUBLIC cxx_std_20)
target_link_libraries(test_conn_exec_retry test_common)
add_test(test_conn_exec_retry test_conn_exec_retry)
if (MSVC)
target_compile_options(test_conn_exec_retry PRIVATE /bigobj)
Expand All @@ -221,6 +227,7 @@ endif()

add_executable(test_conn_push tests/conn_push.cpp)
target_compile_features(test_conn_push PUBLIC cxx_std_20)
target_link_libraries(test_conn_push test_common)
add_test(test_conn_push test_conn_push)
if (MSVC)
target_compile_options(test_conn_push PRIVATE /bigobj)
Expand All @@ -237,7 +244,7 @@ endif()

add_executable(test_conn_reconnect tests/conn_reconnect.cpp)
target_compile_features(test_conn_reconnect PUBLIC cxx_std_20)
target_link_libraries(test_conn_reconnect common)
target_link_libraries(test_conn_reconnect common test_common)
add_test(test_conn_reconnect test_conn_reconnect)
if (MSVC)
target_compile_options(test_conn_reconnect PRIVATE /bigobj)
Expand Down Expand Up @@ -271,16 +278,25 @@ endif()

add_executable(test_conn_exec_cancel tests/conn_exec_cancel.cpp)
target_compile_features(test_conn_exec_cancel PUBLIC cxx_std_20)
target_link_libraries(test_conn_exec_cancel common)
target_link_libraries(test_conn_exec_cancel common test_common)
add_test(test_conn_exec_cancel test_conn_exec_cancel)
if (MSVC)
target_compile_options(test_conn_exec_cancel PRIVATE /bigobj)
target_compile_definitions(test_conn_exec_cancel PRIVATE _WIN32_WINNT=0x0601)
endif()

add_executable(test_conn_exec_cancel2 tests/conn_exec_cancel2.cpp)
target_compile_features(test_conn_exec_cancel2 PUBLIC cxx_std_20)
target_link_libraries(test_conn_exec_cancel2 common test_common)
add_test(test_conn_exec_cancel2 test_conn_exec_cancel2)
if (MSVC)
target_compile_options(test_conn_exec_cancel2 PRIVATE /bigobj)
target_compile_definitions(test_conn_exec_cancel2 PRIVATE _WIN32_WINNT=0x0601)
endif()

add_executable(test_conn_exec_error tests/conn_exec_error.cpp)
target_compile_features(test_conn_exec_error PUBLIC cxx_std_17)
target_link_libraries(test_conn_exec_error common)
target_link_libraries(test_conn_exec_error common test_common)
add_test(test_conn_exec_error test_conn_exec_error)
if (MSVC)
target_compile_options(test_conn_exec_error PRIVATE /bigobj)
Expand All @@ -289,7 +305,7 @@ endif()

add_executable(test_conn_echo_stress tests/conn_echo_stress.cpp)
target_compile_features(test_conn_echo_stress PUBLIC cxx_std_20)
target_link_libraries(test_conn_echo_stress common)
target_link_libraries(test_conn_echo_stress common test_common)
add_test(test_conn_echo_stress test_conn_echo_stress)
if (MSVC)
target_compile_options(test_conn_echo_stress PRIVATE /bigobj)
Expand All @@ -304,22 +320,27 @@ if (MSVC)
target_compile_definitions(test_request PRIVATE _WIN32_WINNT=0x0601)
endif()

if (NOT MSVC)
add_executable(test_issue_50 tests/issue_50.cpp)
target_compile_features(test_issue_50 PUBLIC cxx_std_20)
target_link_libraries(test_issue_50 common)
add_test(test_issue_50 test_issue_50)
if (MSVC)
target_compile_options(test_issue_50 PRIVATE /bigobj)
target_compile_definitions(test_issue_50 PRIVATE _WIN32_WINNT=0x0601)
endif()

if (NOT MSVC)
add_executable(test_conn_check_health tests/conn_check_health.cpp)
target_compile_features(test_conn_check_health PUBLIC cxx_std_17)
target_link_libraries(test_conn_check_health common)
add_test(test_conn_check_health test_conn_check_health)
if (MSVC)
target_compile_options(test_conn_check_health PRIVATE /bigobj)
target_compile_definitions(test_conn_check_health PRIVATE _WIN32_WINNT=0x0601)
endif()

add_executable(test_run tests/run.cpp)
target_compile_features(test_run PUBLIC cxx_std_17)
target_link_libraries(test_run test_common)
add_test(test_run test_run)
if (MSVC)
target_compile_options(test_run PRIVATE /bigobj)
Expand Down
Loading

0 comments on commit 2d53bb7

Please sign in to comment.