[feat] use CROSSDESK_DEBUG compile-time variable to control config file path

This commit is contained in:
dijunkun
2025-10-31 17:31:50 +08:00
parent 2c622bc76e
commit 43db021326
6 changed files with 12 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
#ifdef _WIN32
#ifdef DESK_PORT_DEBUG
#ifdef CROSSDESK_DEBUG
#pragma comment(linker, "/subsystem:\"console\"")
#else
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")

View File

@@ -145,6 +145,10 @@ int Render::ConnectTo(const std::string& remote_id, const char* password,
memcpy(&props->params_, &params_, sizeof(Params));
props->params_.user_id = props->local_id_.c_str();
props->peer_ = CreatePeer(&props->params_);
for (auto& display_info : display_info_list_) {
AddVideoStream(peer_, display_info.name.c_str());
}
AddAudioStream(props->peer_, props->audio_label_.c_str());
AddDataStream(props->peer_, props->data_label_.c_str());

View File

@@ -6,7 +6,7 @@
#define NV12_BUFFER_SIZE 1280 * 720 * 3 / 2
#ifdef DESK_PORT_DEBUG
#ifdef CROSSDESK_DEBUG
#else
#define MOUSE_CONTROL 1
#endif

View File

@@ -18,7 +18,11 @@ std::filesystem::path PathManager::GetConfigPath() {
std::filesystem::path PathManager::GetCachePath() {
#ifdef _WIN32
#ifdef CROSSDESK_DEBUG
return "cache";
#else
return GetKnownFolder(FOLDERID_LocalAppData) / app_name_ / "cache";
#endif
#elif __APPLE__
return GetEnvOrDefault("XDG_CACHE_HOME", GetHome() + "/.cache") / app_name_;
#else

View File

@@ -16,7 +16,7 @@ set_encodings("utf-8")
add_defines("UNICODE")
if is_mode("debug") then
add_defines("DESK_PORT_DEBUG")
add_defines("CROSSDESK_DEBUG")
end
add_requires("spdlog 1.14.1", {system = false})