Skip to content

Commit 389e45c

Browse files
committed
Using boost 1.87 on windows runners in github actions.
1 parent a726bba commit 389e45c

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

.github/workflows/actions_build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
COMMS_TAG: develop
1212
COMMSDSL_TAG: develop
1313
CC_TOOLS_QT_TAG: develop
14+
WIN_BOOST_VERSION: "1.87.0"
15+
WIN_BOOST_DIR: "C:/local/boost_1_87_0"
1416

1517
jobs:
1618
build_gcc_old_ubuntu_20_04:
@@ -558,7 +560,8 @@ jobs:
558560
if: matrix.arch == 'x64'
559561
shell: cmd
560562
run: |
561-
choco install boost-msvc-14.2 --version=1.85.0
563+
choco install boost-msvc-14.2 --version=${{env.WIN_BOOST_VERSION}}
564+
echo BOOST_DIR=${{env.WIN_BOOST_DIR}}/lib64-msvc-14.2/cmake >>%GITHUB_ENV%
562565
563566
- name: Prepare externals
564567
shell: cmd
@@ -583,8 +586,8 @@ jobs:
583586
working-directory: ${{runner.workspace}}/build
584587
run: |
585588
cmake %GITHUB_WORKSPACE% -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install ^
586-
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/build/install;${{env.QTDIR}}" ^
587-
-DCMAKE_POLICY_DEFAULT_CMP0167=OLD -DBoost_USE_STATIC_LIBS=ON ^
589+
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/build/install;${{env.QTDIR}};${{env.BOOST_DIR}}" ^
590+
-DCMAKE_POLICY_DEFAULT_CMP0167=NEW ^
588591
-DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DDEMO3_TOOLS_QT_VER=${{matrix.qt_ver}} ^
589592
-DDEMO3_GEN_PROTOCOL=ON -DDEMO3_GEN_TEST=ON -DDEMO3_GEN_TOOLS=ON -DDEMO3_BUILD_TOOLS=${{env.BUILD_TOOLS}} ^
590593
-DDEMO3_BUILD_EXAMPLES=${{env.HAS_BOOST}}
@@ -618,7 +621,8 @@ jobs:
618621
if: matrix.arch == 'x64'
619622
shell: cmd
620623
run: |
621-
choco install boost-msvc-14.3 --version=1.85.0
624+
choco install boost-msvc-14.3 --version=${{env.WIN_BOOST_VERSION}}
625+
echo BOOST_DIR=${{env.WIN_BOOST_DIR}}/lib64-msvc-14.3/cmake >>%GITHUB_ENV%
622626
623627
- name: Prepare externals
624628
shell: cmd
@@ -641,8 +645,8 @@ jobs:
641645
working-directory: ${{runner.workspace}}/build
642646
run: |
643647
cmake %GITHUB_WORKSPACE% -A ${{matrix.arch}} -DCMAKE_BUILD_TYPE=${{matrix.type}} -DCMAKE_INSTALL_PREFIX=install ^
644-
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/build/install" ^
645-
-DCMAKE_POLICY_DEFAULT_CMP0167=OLD -DBoost_USE_STATIC_LIBS=ON ^
648+
-DCMAKE_PREFIX_PATH="${{runner.workspace}}/build/install;${{env.BOOST_DIR}}" ^
649+
-DCMAKE_POLICY_DEFAULT_CMP0167=NEW ^
646650
-DCMAKE_CXX_STANDARD=${{matrix.cpp}} -DDEMO3_TOOLS_QT_VER=${{matrix.qt_ver}} ^
647651
-DDEMO3_GEN_PROTOCOL=ON -DDEMO3_GEN_TEST=ON -DDEMO3_BUILD_EXAMPLES=${{env.HAS_BOOST}}
648652
env:

examples/client/Client.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,20 @@ Client::Client(
4848
bool Client::start()
4949
{
5050
boost::asio::ip::tcp::resolver resolver(m_io);
51-
auto query = boost::asio::ip::tcp::resolver::query(m_server, std::to_string(m_port));
52-
5351
boost::system::error_code ec;
54-
auto iter = resolver.resolve(query, ec);
52+
auto resolveResult = resolver.resolve(m_server, std::to_string(m_port), ec);
5553
if (ec) {
5654
std::cerr << "ERROR: Failed to resolve \"" << m_server << ':' << m_port << "\" " <<
5755
"with error: " << ec.message() << std::endl;
5856
return false;
5957
}
6058

61-
auto endpoint = iter->endpoint();
59+
if (resolveResult.empty()) {
60+
std::cerr << "ERROR: No resolution result" << std::endl;
61+
return false;
62+
}
63+
64+
auto endpoint = resolveResult.begin()->endpoint();
6265
m_socket.connect(endpoint, ec);
6366
if (ec) {
6467
std::cerr << "ERROR: Failed to connect to \"" << endpoint << "\" " <<

examples/server/Server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bool Server::start()
3838
return false;
3939
}
4040

41-
m_acceptor.listen(Socket::max_connections, ec);
41+
m_acceptor.listen(Socket::max_listen_connections, ec);
4242
if (ec) {
4343
std::cerr << "Failed to listen on port " << m_port << " with error: " << ec.message() << std::endl;
4444
return false;

0 commit comments

Comments
 (0)