fix(linux): unblock parity desktop builds

This commit is contained in:
Haitao Pan 2026-03-21 01:28:33 +08:00
parent e9e72b3fa5
commit 5ea9b639f5
3 changed files with 15 additions and 14 deletions

View File

@ -41,7 +41,7 @@ endif()
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_14)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE -Wall)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
endfunction()

View File

@ -16,6 +16,7 @@ add_executable(${BINARY_NAME}
# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
apply_standard_settings(${BINARY_NAME})
target_compile_options(${BINARY_NAME} PRIVATE -Werror)
# Add preprocessor definitions for the application ID.
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")

View File

@ -16,19 +16,7 @@
#include <string>
#include <vector>
namespace {
constexpr char kChannelName[] = "plus.svc.xworkmate/desktop_platform";
constexpr char kDesktopFileId[] = "plus.svc.xworkmate.desktop";
struct CommandResult {
bool ok = false;
int exit_status = -1;
std::string stdout_text;
std::string stderr_text;
};
struct DesktopPlatformChannel {
struct _DesktopPlatformChannel {
MyApplication* application;
GtkWindow* window;
FlView* view;
@ -47,6 +35,18 @@ struct DesktopPlatformChannel {
std::string status_message;
};
namespace {
constexpr char kChannelName[] = "plus.svc.xworkmate/desktop_platform";
constexpr char kDesktopFileId[] = "plus.svc.xworkmate.desktop";
struct CommandResult {
bool ok = false;
int exit_status = -1;
std::string stdout_text;
std::string stderr_text;
};
std::string json_escape(const std::string& input) {
std::ostringstream escaped;
for (const char ch : input) {