CMake: Yet more MSVC buildfixes
This commit is contained in:
parent
7398eb5d72
commit
80a502bcc9
@ -921,7 +921,9 @@ endif()
|
|||||||
if(BUILD_UPDATER)
|
if(BUILD_UPDATER)
|
||||||
add_executable(updater-stub WIN32 ${CMAKE_CURRENT_SOURCE_DIR}/src/feature/updater-main.c)
|
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})
|
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_RELEASE -s)
|
||||||
set_target_properties(updater-stub PROPERTIES LINK_FLAGS_RELWITHDEBINFO -s)
|
set_target_properties(updater-stub PROPERTIES LINK_FLAGS_RELWITHDEBINFO -s)
|
||||||
endif()
|
endif()
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
#include <synchapi.h>
|
||||||
|
|
||||||
#define mkdir(X, Y) _mkdir(X)
|
#define mkdir(X, Y) _mkdir(X)
|
||||||
#elif defined(_POSIX_C_SOURCE)
|
#elif defined(_POSIX_C_SOURCE)
|
||||||
@ -52,7 +53,11 @@ bool extractArchive(struct VDir* archive, const char* root) {
|
|||||||
errno = 0;
|
errno = 0;
|
||||||
vfOut = VFileOpen(path, O_WRONLY | O_CREAT | O_TRUNC);
|
vfOut = VFileOpen(path, O_WRONLY | O_CREAT | O_TRUNC);
|
||||||
if (!vfOut && errno == EACCES) {
|
if (!vfOut && errno == EACCES) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
Sleep(1000);
|
||||||
|
#else
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
#endif
|
||||||
vfOut = VFileOpen(path, O_WRONLY | O_CREAT | O_TRUNC);
|
vfOut = VFileOpen(path, O_WRONLY | O_CREAT | O_TRUNC);
|
||||||
}
|
}
|
||||||
if (!vfOut) {
|
if (!vfOut) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user