chore: fixed windows branch in get_user_config_dir()

This commit is contained in:
2025-12-07 03:11:47 +03:00
parent 082d0db47b
commit f39d22b5e3
2 changed files with 8 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ set(CORE_SOURCES
src/core/theme/theme_template.cpp src/core/theme/theme_template.cpp
) )
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
add_library(clrsync_core SHARED ${CORE_SOURCES}) add_library(clrsync_core SHARED ${CORE_SOURCES})
target_include_directories(clrsync_core PUBLIC src SYSTEM lib) target_include_directories(clrsync_core PUBLIC src SYSTEM lib)
target_compile_definitions(clrsync_core PRIVATE target_compile_definitions(clrsync_core PRIVATE
@@ -79,9 +80,13 @@ set(GUI_SOURCES
src/gui/settings_window.cpp src/gui/settings_window.cpp
src/gui/font_loader.cpp src/gui/font_loader.cpp
) )
add_executable(clrsync_gui ${GUI_SOURCES}) add_executable(clrsync_gui ${GUI_SOURCES})
target_include_directories(clrsync_gui PRIVATE src SYSTEM lib) 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) if(WIN32)
target_link_libraries(clrsync_gui PRIVATE clrsync_core glfw freetype imgui OpenGL::GL) target_link_libraries(clrsync_gui PRIVATE clrsync_core glfw freetype imgui OpenGL::GL)

View File

@@ -25,9 +25,9 @@ std::filesystem::path config::get_user_config_dir()
{ {
#ifdef _WIN32 #ifdef _WIN32
if (const char *appdata = std::getenv("APPDATA")) if (const char *appdata = std::getenv("APPDATA"))
return fs::path(appdata) / "clrsync"; return std::filesystem::path(appdata) / "clrsync";
else else
return fs::path("C:/clrsync"); return std::filesystem::path("C:/clrsync");
#else #else
if (const char *xdg = std::getenv("XDG_CONFIG_HOME")) if (const char *xdg = std::getenv("XDG_CONFIG_HOME"))
return std::filesystem::path(xdg) / "clrsync"; return std::filesystem::path(xdg) / "clrsync";