set _WIN32_WINNT and WINVER to GGML_WIN_VER under WIN32 instead of MINGW

This commit is contained in:
LIU Xiao 2024-07-03 12:54:56 +08:00
parent 0ad8c88d3f
commit d3cd16601e
2 changed files with 3 additions and 8 deletions

View File

@ -4,11 +4,6 @@ option(LLAMA_SERVER_SSL "Build SSL support for the server" OFF)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
if (MINGW)
# fix: https://github.com/ggerganov/llama.cpp/actions/runs/9651004652/job/26617901362?pr=8006
add_compile_definitions(_WIN32_WINNT=${GGML_WIN_VER})
endif()
set(TARGET_SRCS set(TARGET_SRCS
server.cpp server.cpp
utils.hpp utils.hpp
@ -58,6 +53,7 @@ if (LLAMA_SERVER_SSL)
endif() endif()
if (WIN32) if (WIN32)
add_compile_definitions(-D_WIN32_WINNT=${GGML_WIN_VER} -DWINVER=${GGML_WIN_VER})
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32) TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
endif() endif()

View File

@ -1208,9 +1208,8 @@ if (GGML_CUDA)
add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:${CUDA_FLAGS}>") add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:${CUDA_FLAGS}>")
endif() endif()
if (MINGW) if (WIN32)
# Target Windows 8 for PrefetchVirtualMemory add_compile_definitions(-D_WIN32_WINNT=${GGML_WIN_VER} -DWINVER=${GGML_WIN_VER})
add_compile_definitions(_WIN32_WINNT=${GGML_WIN_VER})
endif() endif()
# #