Skip to content

Commit

Permalink
Merge pull request #293 from egorpugin/sw_fixes
Browse files Browse the repository at this point in the history
[sw] Update build.
  • Loading branch information
dchapyshev authored Jun 26, 2024
2 parents 4ccf6f4 + f108a8b commit 090bbd9
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 25 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/sw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
paths:
- 'source/**'
- '.github/workflows/sw.yml' # for test purposes
schedule:
# every day
- cron: 0 0 * * *

jobs:
windows:
Expand Down Expand Up @@ -38,7 +41,8 @@ jobs:
sudo dnf -y install flex bison cmake which gcc clang clang-tools-extra lld git \
lttng-tools-devel lttng-ust-devel libproxy-devel mesa-libGL-devel mesa-libEGL-devel \
libXfixes-devel libXtst-devel libXext-devel libXrender-devel libX11-devel pulseaudio-libs-devel \
cups-devel wayland-devel libxkbcommon-devel libXdamage-devel libXrandr-devel
cups-devel wayland-devel libxkbcommon-devel libXdamage-devel libXrandr-devel libXcursor-devel \
xcb-util-keysyms-devel xcb-util-cursor-devel libxkbcommon-x11-devel xcb-util-wm-devel
- uses: egorpugin/sw-action@master
- run: ./sw -static build source -compiler gcc
- name: Upload Binaries
Expand Down
1 change: 1 addition & 0 deletions source/base/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <filesystem>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>

Expand Down
10 changes: 0 additions & 10 deletions source/client/translations/aspia_client_pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3202,31 +3202,27 @@
<source>%n seconds</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../ui/router_manager/router_manager_window.cc" line="1767"/>
<source>%n minutes</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../ui/router_manager/router_manager_window.cc" line="1768"/>
<source>%n hours</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../ui/router_manager/router_manager_window.cc" line="1792"/>
<source>%n days</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
Expand Down Expand Up @@ -3384,7 +3380,6 @@
<source>Password can not be empty and should not exceed %n characters.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
Expand All @@ -3397,7 +3392,6 @@
<source>The password must contain lowercase and uppercase characters, numbers and should not be shorter than %n characters.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
Expand Down Expand Up @@ -3700,31 +3694,27 @@
<source>%n seconds</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../ui/sys_info/sys_info_widget.cc" line="143"/>
<source>%n minutes</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../ui/sys_info/sys_info_widget.cc" line="144"/>
<source>%n hours</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../ui/sys_info/sys_info_widget.cc" line="168"/>
<source>%n days</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
Expand Down
2 changes: 1 addition & 1 deletion source/client/ui/client_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void ClientSettings::setCheckUpdates(bool check)
//--------------------------------------------------------------------------------------------------
QString ClientSettings::updateServer() const
{
return settings_.value(kUpdateServerParam, DEFAULT_UPDATE_SERVER).toString().toLower();
return settings_.value(kUpdateServerParam, QString::fromStdU16String(DEFAULT_UPDATE_SERVER)).toString().toLower();
}

//--------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion source/console/settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ void Settings::setCheckUpdates(bool check)
//--------------------------------------------------------------------------------------------------
QString Settings::updateServer() const
{
return settings_.value(kUpdateServerParam, DEFAULT_UPDATE_SERVER).toString().toLower();
return settings_.value(kUpdateServerParam, QString::fromStdU16String(DEFAULT_UPDATE_SERVER)).toString().toLower();
}

//--------------------------------------------------------------------------------------------------
Expand Down
43 changes: 31 additions & 12 deletions source/sw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void build(Solution &s) {
auto &aspia = s.addProject("aspia", "2.8.0");
aspia += Git("https://github.com/dchapyshev/aspia", "v{v}");

constexpr auto cppstd = cpp17;
constexpr auto cppstd = cpp20;

auto setup_target = [&](auto &t, const String &name, bool add_tests = false, String dir = {}) -> decltype(auto) {
if (dir.empty())
Expand Down Expand Up @@ -115,14 +115,18 @@ void build(Solution &s) {
base -= "peer/stun_server.cc";
base -= "peer/stun_peer.cc";
if (base.getBuildSettings().TargetOS.Type == OSType::Windows) {
base -= "strings/string_util_icu.cc";
base.Public += "UNICODE"_def;
base.Public += "WIN32_LEAN_AND_MEAN"_def;
base.Public += "NOMINMAX"_def;
} else {
base -= "strings/string_util_win.cc";
}
base.Public += protocol;
base.Public += "org.sw.demo.qtproject.qt.base.widgets" QT_VERSION ""_dep;
base.Public += "org.sw.demo.qtproject.qt.base.network" QT_VERSION ""_dep;
base.Public += "org.sw.demo.qtproject.qt.base.xml" QT_VERSION ""_dep;
base.Public += "org.sw.demo.qtproject.qt.labs.vstools.natvis.qt6"_dep;
base.Public += "org.sw.demo.boost.align"_dep;
base.Public += "org.sw.demo.imneme.pcg_cpp-master"_dep;
base.Public += "org.sw.demo.chriskohlhoff.asio"_dep;
Expand All @@ -135,6 +139,7 @@ void build(Solution &s) {
base.Public += "org.sw.demo.xiph.opus"_dep;
base.Public += "org.sw.demo.sqlite3"_dep;
base.Public += "org.sw.demo.badger.curl.libcurl"_dep;
base.Public += "org.sw.demo.fmt"_dep;
if (base.getBuildSettings().TargetOS.Type == OSType::Windows) {
base.Public += "com.Microsoft.Windows.SDK.winrt"_dep;
base +=
Expand Down Expand Up @@ -272,28 +277,30 @@ void build(Solution &s) {
}

//
auto &client_core = add_lib("client");
auto &client = aspia.addExecutable("client");
auto &client_core = client.addStaticLibrary("core");
{
setup_target(client_core, "client");
client_core += ".*"_rr;
client_core.Public += common;
client_core.Public += "org.sw.demo.qtproject.qt.base.printsupport" QT_VERSION ""_dep;
if (client_core.getBuildSettings().TargetOS.Type == OSType::Windows && QT_VERSION_NUMBER == 5)
client_core.Public += "org.sw.demo.qtproject.qt.base.plugins.printsupport.windows" QT_VERSION ""_dep;
else if (client_core.getBuildSettings().TargetOS.Type == OSType::Linux)
client_core.Public += "org.sw.demo.qtproject.qt.base.plugins.printsupport.cups" QT_VERSION ""_dep;
qt_progs_and_tr(client_core);
qt_progs_and_tr(client_core, "client");
}

auto setup_exe = [&](auto &t) -> decltype(auto) {
auto setup_exe = [&](auto &t, bool console = false) -> decltype(auto) {
t += cppstd;
if (t.getBuildSettings().TargetOS.Type == OSType::Windows) {
if (t.getBuildSettings().TargetOS.Type == OSType::Windows && !console) {
if (auto L = t.getSelectedTool()->template as<VisualStudioLinker*>(); L)
L->Subsystem = vs::Subsystem::Windows;
t += "org.sw.demo.qtproject.qt.base.winmain" QT_VERSION ""_dep;
}
if (t.getBuildSettings().TargetOS.Type == OSType::Windows) {
t.Public += "org.sw.demo.qtproject.qt.base.plugins.platforms.windows" QT_VERSION ""_dep;
t.Public += "org.sw.demo.qtproject.qt.base.plugins.styles.windowsvista" QT_VERSION ""_dep;
t.Public += "org.sw.demo.qtproject.qt.base.plugins.styles.modernwindows" QT_VERSION ""_dep;
}
if (t.getBuildSettings().TargetOS.Type == OSType::Linux) {
t.Public += "org.sw.demo.qtproject.qt.wayland.plugins.platforms.qwayland.generic" QT_VERSION ""_dep;
Expand All @@ -307,8 +314,8 @@ void build(Solution &s) {
}
return t;
};
auto add_exe = [&](auto &base, const String &name) -> decltype(auto) {
return setup_exe(base.addExecutable(name));
auto add_exe = [&](auto &base, const String &name, bool console = false) -> decltype(auto) {
return setup_exe(base.addExecutable(name), console);
};

//
Expand All @@ -317,7 +324,8 @@ void build(Solution &s) {
console.Public += client_core, qt_base;
qt_progs_and_tr(console);

auto &client = add_exe(aspia, "client_exe");
// client
setup_exe(client);
client += "client/client_entry_point.cc";
client += "client/client.rc";
client += client_core, qt_base;
Expand All @@ -333,28 +341,39 @@ void build(Solution &s) {
core.Public += common, qt_base;
core.Public += "org.sw.demo.boost.property_tree"_dep;
if (core.getBuildSettings().TargetOS.Type == OSType::Windows) {
core.Public += "com.Microsoft.VisualStudio.VC.ATLMFC"_dep;
core.Public += "org.sw.demo.wtl"_dep;
core += "DXGI.lib"_slib;
core += "d3d11.lib"_slib;
}
qt_progs_and_tr2(core);
if (core.getBuildSettings().TargetOS.Type == OSType::Windows) {
core.Public += "org.sw.demo.qtproject.qt.base.plugins.platforms.windows" QT_VERSION ""_dep;
core.Public += "org.sw.demo.qtproject.qt.base.plugins.styles.windowsvista" QT_VERSION ""_dep;
core.Public += "org.sw.demo.qtproject.qt.base.plugins.styles.modernwindows" QT_VERSION ""_dep;
}

setup_exe(host);
host += "host/ui/host_entry_point.cc";
host += "host/ui/host.rc";
host += core;

auto &service = add_exe(host, "service");
auto &service = add_exe(host, "service", true);
service += "host/service_entry_point.cc";
service += "host/service.rc";
service += core;

auto &desktop_agent = add_exe(aspia, "desktop_agent");
auto &desktop_agent = add_exe(host, "desktop_agent");
desktop_agent += "host/desktop_agent_entry_point.cc";
desktop_agent += "host/desktop_agent.rc";
desktop_agent += core;

auto &file_transfer_agent = add_exe(host, "file_transfer_agent");
file_transfer_agent += "host/file_transfer_agent_entry_point.cc";
file_transfer_agent += "host/file_transfer_agent.rc";
file_transfer_agent += core;

// integrity
// find . -name "*.cc" | xargs grep "aspia_.*\?\.exe\"" {}
// core.patch()
}
}

0 comments on commit 090bbd9

Please sign in to comment.