CMake: Yet more MSVC buildfixes

This commit is contained in:
Vicki Pfau 2021-08-22 15:01:40 -07:00
parent 7398eb5d72
commit 80a502bcc9
2 changed files with 8 additions and 1 deletions

View File

@ -921,7 +921,9 @@ endif()
if(BUILD_UPDATER)
add_executable(updater-stub WIN32 ${CMAKE_CURRENT_SOURCE_DIR}/src/feature/updater-main.c)
target_link_libraries(updater-stub ${OS_LIB} ${PLATFORM_LIBRARY} ${BINARY_NAME})
if(NOT MSVC)
if(MSVC)
set_target_properties(updater-stub PROPERTIES LINK_FLAGS /ENTRY:mainCRTStartup)
else()
set_target_properties(updater-stub PROPERTIES LINK_FLAGS_RELEASE -s)
set_target_properties(updater-stub PROPERTIES LINK_FLAGS_RELWITHDEBINFO -s)
endif()

View File

@ -16,6 +16,7 @@
#include <direct.h>
#include <io.h>
#include <process.h>
#include <synchapi.h>
#define mkdir(X, Y) _mkdir(X)
#elif defined(_POSIX_C_SOURCE)
@ -52,7 +53,11 @@ bool extractArchive(struct VDir* archive, const char* root) {
errno = 0;
vfOut = VFileOpen(path, O_WRONLY | O_CREAT | O_TRUNC);
if (!vfOut && errno == EACCES) {
#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
vfOut = VFileOpen(path, O_WRONLY | O_CREAT | O_TRUNC);
}
if (!vfOut) {