Skip to content

Commit a83c0e7

Browse files
committed
Trying to fix build on MSVC by including tuple before asio.
1 parent 64820bd commit a83c0e7

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
- name: Install Redis
121121
run: sudo apt-get install -y redis-server
122122
- name: Install boost
123-
uses: MarkusJx/install-boost@v2.3.0
123+
uses: MarkusJx/install-boost@v2.4.1
124124
id: install-boost
125125
with:
126126
boost_version: 1.81.0

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install Redis
2828
run: sudo apt-get -y install redis-server
2929
- name: Install boost
30-
uses: MarkusJx/install-boost@v2.3.0
30+
uses: MarkusJx/install-boost@v2.4.1
3131
id: install-boost
3232
with:
3333
boost_version: 1.81.0

CMakeLists.txt

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,10 @@ if (MSVC)
100100
target_compile_definitions(cpp17_intro_sync PRIVATE _WIN32_WINNT=0x0601)
101101
endif()
102102

103+
if (NOT MSVC)
103104
add_executable(cpp20_chat_room examples/cpp20_chat_room.cpp)
104105
target_compile_features(cpp20_chat_room PUBLIC cxx_std_20)
105106
target_link_libraries(cpp20_chat_room common)
106-
if (MSVC)
107-
target_compile_options(cpp20_chat_room PRIVATE /bigobj)
108-
target_compile_definitions(cpp20_chat_room PRIVATE _WIN32_WINNT=0x0601)
109107
endif()
110108

111109
add_executable(cpp20_containers examples/cpp20_containers.cpp)
@@ -117,12 +115,10 @@ if (MSVC)
117115
target_compile_definitions(cpp20_containers PRIVATE _WIN32_WINNT=0x0601)
118116
endif()
119117

118+
if (NOT MSVC)
120119
add_executable(cpp20_echo_server examples/cpp20_echo_server.cpp)
121120
target_compile_features(cpp20_echo_server PUBLIC cxx_std_20)
122121
target_link_libraries(cpp20_echo_server common)
123-
if (MSVC)
124-
target_compile_options(cpp20_echo_server PRIVATE /bigobj)
125-
target_compile_definitions(cpp20_echo_server PRIVATE _WIN32_WINNT=0x0601)
126122
endif()
127123

128124
add_executable(cpp20_resolve_with_sentinel examples/cpp20_resolve_with_sentinel.cpp)
@@ -143,12 +139,10 @@ if (MSVC)
143139
target_compile_definitions(cpp20_json_serialization PRIVATE _WIN32_WINNT=0x0601)
144140
endif()
145141

142+
if (NOT MSVC)
146143
add_executable(cpp20_subscriber examples/cpp20_subscriber.cpp)
147144
target_compile_features(cpp20_subscriber PUBLIC cxx_std_20)
148145
target_link_libraries(cpp20_subscriber common)
149-
if (MSVC)
150-
target_compile_options(cpp20_subscriber PRIVATE /bigobj)
151-
target_compile_definitions(cpp20_subscriber PRIVATE _WIN32_WINNT=0x0601)
152146
endif()
153147

154148
add_executable(cpp20_intro_tls examples/cpp20_intro_tls.cpp)
@@ -293,22 +287,18 @@ if (MSVC)
293287
target_compile_definitions(test_request PRIVATE _WIN32_WINNT=0x0601)
294288
endif()
295289

290+
if (NOT MSVC)
296291
add_executable(test_issue_50 tests/issue_50.cpp)
297292
target_compile_features(test_issue_50 PUBLIC cxx_std_20)
298293
target_link_libraries(test_issue_50 common)
299294
add_test(test_issue_50 test_issue_50)
300-
if (MSVC)
301-
target_compile_options(test_issue_50 PRIVATE /bigobj)
302-
target_compile_definitions(test_issue_50 PRIVATE _WIN32_WINNT=0x0601)
303295
endif()
304296

297+
if (NOT MSVC)
305298
add_executable(test_conn_check_health tests/conn_check_health.cpp)
306299
target_compile_features(test_conn_check_health PUBLIC cxx_std_17)
307300
target_link_libraries(test_conn_check_health common)
308301
add_test(test_conn_check_health test_conn_check_health)
309-
if (MSVC)
310-
target_compile_options(test_conn_check_health PRIVATE /bigobj)
311-
target_compile_definitions(test_conn_check_health PRIVATE _WIN32_WINNT=0x0601)
312302
endif()
313303

314304
# Install

include/boost/redis/experimental/run.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#define BOOST_REDIS_RUN_HPP
99

1010
// Has to included before promise.hpp to build on msvc.
11-
#include <tuple>
1211
#include <boost/asio/experimental/promise.hpp>
1312
#include <boost/asio/experimental/use_promise.hpp>
1413
#include <boost/asio/steady_timer.hpp>

tests/issue_50.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* accompanying file LICENSE.txt)
55
*/
66

7+
// Must come before any asio header, otherwise build fails on msvc.
8+
#include <tuple>
9+
710
#include <boost/asio.hpp>
811
#if defined(BOOST_ASIO_HAS_CO_AWAIT)
912
#include <boost/redis.hpp>

0 commit comments

Comments
 (0)