build: fix msvc builds

This commit is contained in:
2025-12-18 11:51:28 +03:00
parent 1a1747a472
commit 613c2c80f5
4 changed files with 13 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ name: Test PKGBUILD-git
on:
push:
branch: master
branches: master
pull_request:
branches: master

1
.gitignore vendored
View File

@@ -4,6 +4,7 @@
out
build/
build-msvc/
CMakeCache.txt
CMakeFiles/
cmake_install.cmake

View File

@@ -6,7 +6,7 @@
namespace clrsync::core
{
const std::string GIT_SEMVER = "0.1.6+git.g57c3c55";
const std::string GIT_SEMVER = "0.1.6+git.g1a1747a";
const std::string version_string();
} // namespace clrsync::core

View File

@@ -19,7 +19,11 @@ if(APPLE)
list(APPEND GUI_SOURCES file_browser_macos.mm)
endif()
add_executable(clrsync_gui ${GUI_SOURCES})
if(WIN32)
add_executable(clrsync_gui WIN32 ${GUI_SOURCES})
else()
add_executable(clrsync_gui ${GUI_SOURCES})
endif()
target_include_directories(clrsync_gui PRIVATE
${CMAKE_SOURCE_DIR}/src
@@ -38,7 +42,9 @@ if(WIN32)
comdlg32
shlwapi
)
set_target_properties(clrsync_gui PROPERTIES WIN32_EXECUTABLE TRUE)
if (MSVC)
target_link_options(clrsync_gui PRIVATE /ENTRY:mainCRTStartup)
endif()
elseif(APPLE)
target_link_libraries(clrsync_gui PRIVATE
clrsync_core