Skip to content

Commit cf31641

Browse files
committed
Update github actions and appveyor to have C++ 20
2 parents 8b3f6de + d1b1bb8 commit cf31641

11 files changed

Lines changed: 37 additions & 27 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1111
BUILD_TYPE: RelWithDebInfo
12-
VCPKG_REF: '408ffb232c30189278a3deb30fb51622036692d5'
12+
VCPKG_REF: '000d1bda1ffa95a73e0b40334fa4103d6f4d3d48'
1313

1414
jobs:
1515
build-windows:
@@ -63,18 +63,30 @@ jobs:
6363
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
6464
# You can convert this to a matrix build if you need cross-platform coverage.
6565
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
66-
runs-on: ubuntu-latest
66+
runs-on: ubuntu-22.04
6767

6868
steps:
6969
- uses: actions/checkout@v2
7070

71+
- name: Install Clang
72+
run: |
73+
wget https://apt.llvm.org/llvm.sh
74+
chmod +x llvm.sh
75+
sudo ./llvm.sh 17
76+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 170
77+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 170
78+
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
79+
sudo update-alternatives --config clang
80+
sudo update-alternatives --config clang++
81+
sudo update-alternatives --config c++
82+
7183
- name: Install build dependencies
7284
# Catch2 is not yet in the ubuntu repo, so install it ourselves
7385
run: |
7486
sudo apt-get install -y ghostscript imagemagick
7587
sudo apt-get install -y libboost-all-dev qtbase5-dev qttools5-dev
76-
sudo git clone -b v2.x https://github.com/catchorg/Catch2.git /tmp/catch2
77-
sudo cmake -H/tmp/catch2 -B/tmp/catch2.build -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
88+
sudo git clone -b v3.4.0 https://github.com/catchorg/Catch2.git /tmp/catch2
89+
sudo cmake -S/tmp/catch2 -B/tmp/catch2.build -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
7890
sudo cmake --build /tmp/catch2.build -- install
7991
8092
- name: Configure CMake

appveyor.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image:
2-
- Visual Studio 2019
3-
- ubuntu2004
2+
- Visual Studio 2022
3+
- ubuntu2204
44

55
configuration:
66
- release
@@ -15,15 +15,15 @@ environment:
1515
APPVEYOR_SAVE_CACHE_ON_ERROR: true
1616
VCPKG_DIR: C:\Tools\vcpkg
1717
VCPKG_BINARY_SOURCES: 'clear;files,C:\Tools\vcpkg.cache,readwrite'
18-
VCPKG_REF: '408ffb232c30189278a3deb30fb51622036692d5'
18+
VCPKG_REF: '000d1bda1ffa95a73e0b40334fa4103d6f4d3d48'
1919
VCPKG_DEFAULT_TRIPLET: x64-windows
2020
QT_DIR: C:\Qt\5.15\msvc2019_64
2121
BUILD_TYPE: RelWithDebInfo
2222

2323
init:
2424
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
2525
- echo %CONFIGURATION%
26-
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
26+
- cmd: call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
2727
#- cmd: set Path=%QT_DIR%\bin;%Path%
2828

2929
install:
@@ -42,18 +42,18 @@ install:
4242
- sh: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
4343
- sh: sudo add-apt-repository ppa:mhier/libboost-latest
4444
- sh: wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
45-
- sh: sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
45+
- sh: sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ jammy main'
4646
- sh: sudo apt update -q
4747
- sh: sudo apt install -yq build-essential ninja-build git cmake clang imagemagick
4848
- sh: sudo apt install -yq libboost-all-dev qtbase5-dev qttools5-dev
4949
# Catch2 is not yet in a repo, so build+install ourselves
50-
- sh: git clone -b v2.x https://github.com/catchorg/Catch2.git ~/catch2
50+
- sh: git clone -b v3.4.0 https://github.com/catchorg/Catch2.git ~/catch2
5151
- sh: cmake -S~/catch2 -B~/catch2.build -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr
5252
- sh: sudo cmake --build ~/catch2.build -- install
5353

5454

5555
before_build:
56-
- cmd: cmake -G "Visual Studio 16 2019" -A x64 -T v142 -DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -H%APPVEYOR_BUILD_FOLDER% -B%APPVEYOR_BUILD_FOLDER%/build
56+
- cmd: cmake -G "Visual Studio 17 2022" -A x64 -DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -H%APPVEYOR_BUILD_FOLDER% -B%APPVEYOR_BUILD_FOLDER%/build
5757
- sh: cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -S${APPVEYOR_BUILD_FOLDER} -B${APPVEYOR_BUILD_FOLDER}/build
5858

5959
build_script:

lib/network/ssdpBridge.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <Denon/network/ssdpBridge.h>
22

3-
#define DEBUG_LVL 1
3+
//#define DEBUG_LVL 2
44
#ifdef DEBUG_LVL
55
#include <iostream>
66
#endif
@@ -73,8 +73,10 @@ void Bridge::OnReceiveFromServer(boost::asio::ip::address_v4 sender, const std::
7373
m_cache.services[key] = *pNotify;
7474
}
7575

76-
//std::cout << "Server: Notify -> client\n";
77-
//m_Client.send(data);
76+
#if DEBUG_LVL > 0
77+
std::cout << "Server: Notify -> client\n";
78+
#endif
79+
m_Client.broadcast(data);
7880
}
7981
else if(auto pResponse = std::get_if<Ssdp::Response>(&sn))
8082
{

qtui/SsdpClient.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void SsdpClient::onRead()
4949
}
5050
catch(std::exception& e)
5151
{
52-
std::throw_with_nested(std::runtime_error("Ssdp Parse error: "sv + e.what()));
52+
std::throw_with_nested(std::runtime_error(std::string("Ssdp Parse error: ") + e.what()));
5353
}
5454
}
5555
};

qtui/UpnpEvents.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#include "UpnpEvents.h"
22

3+
#include <iostream>
4+
#include <sstream>
35
#include <boost/property_tree/xml_parser.hpp>
46

57

68
#include <Denon/network/http.h>
79
#include <Denon/string.h>
810
#include <Denon/upnpEvent.h>
911

10-
#include <iostream>
11-
#include <sstream>
12-
1312

1413
constexpr int listenPort = 49200;
1514
constexpr int uPnpPort = 60006;
@@ -121,7 +120,7 @@ void UpnpEvents::onCbRead()
121120
}
122121
catch(std::exception& e)
123122
{
124-
std::throw_with_nested(std::runtime_error("UpnpEvents.onCbRead, parsing failed: "sv + e.what()));
123+
std::throw_with_nested(std::runtime_error(std::string("UpnpEvents.onCbRead, parsing failed: ") + e.what()));
125124
}
126125

127126
Denon::Http::Response resp;

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ endforeach()
2727

2828
target_link_libraries(${PROJECT_NAME}
2929
Denon
30-
Catch2::Catch2
30+
Catch2::Catch2WithMain
3131
)
3232

3333
include(CTest)

test/avTransport.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <catch2/catch.hpp>
1+
#include <catch2/catch_all.hpp>
22
//#include <catch2/catch_test_macros.hpp>
33

44
#include <Denon/network/ssdp.h>

test/http.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <catch2/catch.hpp>
1+
#include <catch2/catch_all.hpp>
22
//#include <catch2/catch_test_macros.hpp>
33

44
#include <iostream>

test/main.cc

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/ssdp.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#include <catch2/catch.hpp>
2-
//#include <catch2/catch_all.hpp>
1+
#include <catch2/catch_all.hpp>
32

43
#include <iostream>
54

0 commit comments

Comments
 (0)