Use C++20. (#2322)
This commit is contained in:
parent
9288775351
commit
7fb8c76590
16 changed files with 29 additions and 16 deletions
6
.github/workflows/CI.yml
vendored
6
.github/workflows/CI.yml
vendored
|
|
@ -280,7 +280,7 @@ jobs:
|
||||||
include: # package these differently
|
include: # package these differently
|
||||||
- type: AppImage
|
- type: AppImage
|
||||||
EXTRA_ARGS: '-DSUNSHINE_BUILD_APPIMAGE=ON'
|
EXTRA_ARGS: '-DSUNSHINE_BUILD_APPIMAGE=ON'
|
||||||
dist: 20.04
|
dist: 22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Maximize build space
|
- name: Maximize build space
|
||||||
|
|
@ -323,6 +323,9 @@ jobs:
|
||||||
# allow newer gcc
|
# allow newer gcc
|
||||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
|
|
||||||
|
# allow libfuse2 for appimage on 22.04
|
||||||
|
sudo add-apt-repository universe
|
||||||
|
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
cmake \
|
cmake \
|
||||||
|
|
@ -338,6 +341,7 @@ jobs:
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
libdrm-dev \
|
libdrm-dev \
|
||||||
libevdev-dev \
|
libevdev-dev \
|
||||||
|
libfuse2 \
|
||||||
libminiupnpc-dev \
|
libminiupnpc-dev \
|
||||||
libmfx-dev \
|
libmfx-dev \
|
||||||
libnotify-dev \
|
libnotify-dev \
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ endif()
|
||||||
|
|
||||||
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
|
target_link_libraries(sunshine ${SUNSHINE_EXTERNAL_LIBRARIES} ${EXTRA_LIBS})
|
||||||
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
target_compile_definitions(sunshine PUBLIC ${SUNSHINE_DEFINITIONS})
|
||||||
set_target_properties(sunshine PROPERTIES CXX_STANDARD 17
|
set_target_properties(sunshine PROPERTIES CXX_STANDARD 20
|
||||||
VERSION ${PROJECT_VERSION}
|
VERSION ${PROJECT_VERSION}
|
||||||
SOVERSION ${PROJECT_VERSION_MAJOR})
|
SOVERSION ${PROJECT_VERSION_MAJOR})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/property_tree/json_parser.hpp>
|
#include <boost/property_tree/json_parser.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
using namespace std::literals;
|
using namespace std::literals;
|
||||||
|
|
||||||
|
|
@ -169,7 +170,9 @@ namespace net {
|
||||||
addr_to_url_escaped_string(boost::asio::ip::address address) {
|
addr_to_url_escaped_string(boost::asio::ip::address address) {
|
||||||
address = normalize_address(address);
|
address = normalize_address(address);
|
||||||
if (address.is_v6()) {
|
if (address.is_v6()) {
|
||||||
return "["s + address.to_string() + ']';
|
std::stringstream ss;
|
||||||
|
ss << '[' << address.to_string() << ']';
|
||||||
|
return ss.str();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return address.to_string();
|
return address.to_string();
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
// standard includes
|
// standard includes
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
// lib includes
|
// lib includes
|
||||||
#include <Simple-Web-Server/server_http.hpp>
|
#include <Simple-Web-Server/server_http.hpp>
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ namespace cuda {
|
||||||
fs::path sysfs_dir { sysfs_path };
|
fs::path sysfs_dir { sysfs_path };
|
||||||
for (auto &entry : fs::directory_iterator { sysfs_dir }) {
|
for (auto &entry : fs::directory_iterator { sysfs_dir }) {
|
||||||
auto file = entry.path().filename();
|
auto file = entry.path().filename();
|
||||||
auto filestring = file.generic_u8string();
|
auto filestring = file.generic_string();
|
||||||
if (std::string_view { filestring }.substr(0, 4) != "card"sv) {
|
if (std::string_view { filestring }.substr(0, 4) != "card"sv) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -1049,4 +1049,4 @@ namespace platf {
|
||||||
|
|
||||||
return display_names;
|
return display_names;
|
||||||
}
|
}
|
||||||
} // namespace platf
|
} // namespace platf
|
||||||
|
|
|
||||||
|
|
@ -1510,7 +1510,7 @@ namespace platf {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << std::hex << std::setfill('0');
|
ss << std::hex << std::setfill('0');
|
||||||
for (const auto &ch : str) {
|
for (const auto &ch : str) {
|
||||||
ss << ch;
|
ss << static_cast<uint_least32_t>(ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string hex_unicode(ss.str());
|
std::string hex_unicode(ss.str());
|
||||||
|
|
|
||||||
|
|
@ -614,7 +614,7 @@ namespace platf {
|
||||||
for (auto &entry : fs::directory_iterator { card_dir }) {
|
for (auto &entry : fs::directory_iterator { card_dir }) {
|
||||||
auto file = entry.path().filename();
|
auto file = entry.path().filename();
|
||||||
|
|
||||||
auto filestring = file.generic_u8string();
|
auto filestring = file.generic_string();
|
||||||
if (filestring.size() < 4 || std::string_view { filestring }.substr(0, 4) != "card"sv) {
|
if (filestring.size() < 4 || std::string_view { filestring }.substr(0, 4) != "card"sv) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -1641,7 +1641,7 @@ namespace platf {
|
||||||
for (auto &entry : fs::directory_iterator { card_dir }) {
|
for (auto &entry : fs::directory_iterator { card_dir }) {
|
||||||
auto file = entry.path().filename();
|
auto file = entry.path().filename();
|
||||||
|
|
||||||
auto filestring = file.generic_u8string();
|
auto filestring = file.generic_string();
|
||||||
if (std::string_view { filestring }.substr(0, 4) != "card"sv) {
|
if (std::string_view { filestring }.substr(0, 4) != "card"sv) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1411,7 +1411,7 @@ namespace platf {
|
||||||
ds4_update_state(gamepad_context_t &gamepad, const gamepad_state_t &gamepad_state) {
|
ds4_update_state(gamepad_context_t &gamepad, const gamepad_state_t &gamepad_state) {
|
||||||
auto &report = gamepad.report.ds4.Report;
|
auto &report = gamepad.report.ds4.Report;
|
||||||
|
|
||||||
report.wButtons = ds4_buttons(gamepad_state) | ds4_dpad(gamepad_state);
|
report.wButtons = static_cast<uint16_t>(ds4_buttons(gamepad_state)) | static_cast<uint16_t>(ds4_dpad(gamepad_state));
|
||||||
report.bSpecial = ds4_special_buttons(gamepad_state);
|
report.bSpecial = ds4_special_buttons(gamepad_state);
|
||||||
|
|
||||||
report.bTriggerL = gamepad_state.lt;
|
report.bTriggerL = gamepad_state.lt;
|
||||||
|
|
|
||||||
|
|
@ -1691,8 +1691,8 @@ namespace platf {
|
||||||
}
|
}
|
||||||
int64_t
|
int64_t
|
||||||
qpc_counter() {
|
qpc_counter() {
|
||||||
LARGE_INTEGER performace_counter;
|
LARGE_INTEGER performance_counter;
|
||||||
if (QueryPerformanceCounter(&performace_counter)) return performace_counter.QuadPart;
|
if (QueryPerformanceCounter(&performance_counter)) return performance_counter.QuadPart;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ extern "C" {
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
* @brief todo
|
* @brief todo
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ list(REMOVE_ITEM SUNSHINE_SOURCES ${CMAKE_SOURCE_DIR}/src/main.cpp)
|
||||||
add_executable(${PROJECT_NAME}
|
add_executable(${PROJECT_NAME}
|
||||||
${TEST_SOURCES}
|
${TEST_SOURCES}
|
||||||
${SUNSHINE_SOURCES})
|
${SUNSHINE_SOURCES})
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 17)
|
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
${SUNSHINE_EXTERNAL_LIBRARIES}
|
${SUNSHINE_EXTERNAL_LIBRARIES}
|
||||||
gtest
|
gtest
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ project(sunshine_tools)
|
||||||
include_directories("${CMAKE_SOURCE_DIR}")
|
include_directories("${CMAKE_SOURCE_DIR}")
|
||||||
|
|
||||||
add_executable(dxgi-info dxgi.cpp)
|
add_executable(dxgi-info dxgi.cpp)
|
||||||
set_target_properties(dxgi-info PROPERTIES CXX_STANDARD 17)
|
set_target_properties(dxgi-info PROPERTIES CXX_STANDARD 20)
|
||||||
target_link_libraries(dxgi-info
|
target_link_libraries(dxgi-info
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
dxgi
|
dxgi
|
||||||
|
|
@ -13,7 +13,7 @@ target_link_libraries(dxgi-info
|
||||||
target_compile_options(dxgi-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
|
target_compile_options(dxgi-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
|
||||||
|
|
||||||
add_executable(audio-info audio.cpp)
|
add_executable(audio-info audio.cpp)
|
||||||
set_target_properties(audio-info PROPERTIES CXX_STANDARD 17)
|
set_target_properties(audio-info PROPERTIES CXX_STANDARD 20)
|
||||||
target_link_libraries(audio-info
|
target_link_libraries(audio-info
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
ksuser
|
ksuser
|
||||||
|
|
@ -21,7 +21,7 @@ target_link_libraries(audio-info
|
||||||
target_compile_options(audio-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
|
target_compile_options(audio-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
|
||||||
|
|
||||||
add_executable(sunshinesvc sunshinesvc.cpp)
|
add_executable(sunshinesvc sunshinesvc.cpp)
|
||||||
set_target_properties(sunshinesvc PROPERTIES CXX_STANDARD 17)
|
set_target_properties(sunshinesvc PROPERTIES CXX_STANDARD 20)
|
||||||
target_link_libraries(sunshinesvc
|
target_link_libraries(sunshinesvc
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
wtsapi32
|
wtsapi32
|
||||||
|
|
@ -29,7 +29,7 @@ target_link_libraries(sunshinesvc
|
||||||
target_compile_options(sunshinesvc PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
|
target_compile_options(sunshinesvc PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
|
||||||
|
|
||||||
add_executable(ddprobe ddprobe.cpp)
|
add_executable(ddprobe ddprobe.cpp)
|
||||||
set_target_properties(ddprobe PROPERTIES CXX_STANDARD 17)
|
set_target_properties(ddprobe PROPERTIES CXX_STANDARD 20)
|
||||||
target_link_libraries(ddprobe
|
target_link_libraries(ddprobe
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
dxgi
|
dxgi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue