From f39d22b5e334e69ac538558cfc27026144fc9cff Mon Sep 17 00:00:00 2001 From: Daniel Dada Date: Sun, 7 Dec 2025 03:11:47 +0300 Subject: [PATCH] chore: fixed windows branch in get_user_config_dir() --- CMakeLists.txt | 7 ++++++- src/core/config/config.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 166d455..3b799a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ set(CORE_SOURCES src/core/theme/theme_template.cpp ) +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) add_library(clrsync_core SHARED ${CORE_SOURCES}) target_include_directories(clrsync_core PUBLIC src SYSTEM lib) target_compile_definitions(clrsync_core PRIVATE @@ -79,9 +80,13 @@ set(GUI_SOURCES src/gui/settings_window.cpp src/gui/font_loader.cpp ) - add_executable(clrsync_gui ${GUI_SOURCES}) target_include_directories(clrsync_gui PRIVATE src SYSTEM lib) +if(WIN32) + set_target_properties(clrsync_gui PROPERTIES + LINK_FLAGS "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup" + ) +endif() if(WIN32) target_link_libraries(clrsync_gui PRIVATE clrsync_core glfw freetype imgui OpenGL::GL) diff --git a/src/core/config/config.cpp b/src/core/config/config.cpp index f5126c4..684dbe6 100644 --- a/src/core/config/config.cpp +++ b/src/core/config/config.cpp @@ -25,9 +25,9 @@ std::filesystem::path config::get_user_config_dir() { #ifdef _WIN32 if (const char *appdata = std::getenv("APPDATA")) - return fs::path(appdata) / "clrsync"; + return std::filesystem::path(appdata) / "clrsync"; else - return fs::path("C:/clrsync"); + return std::filesystem::path("C:/clrsync"); #else if (const char *xdg = std::getenv("XDG_CONFIG_HOME")) return std::filesystem::path(xdg) / "clrsync";