From d3cd16601e7947443740bcc00f09833e8b79a7f5 Mon Sep 17 00:00:00 2001 From: LIU Xiao Date: Wed, 3 Jul 2024 12:54:56 +0800 Subject: [PATCH] set _WIN32_WINNT and WINVER to GGML_WIN_VER under WIN32 instead of MINGW --- examples/server/CMakeLists.txt | 6 +----- ggml/src/CMakeLists.txt | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index dbe41f1fd..ff45c85fe 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -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}) -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 server.cpp utils.hpp @@ -58,6 +53,7 @@ if (LLAMA_SERVER_SSL) endif() if (WIN32) + add_compile_definitions(-D_WIN32_WINNT=${GGML_WIN_VER} -DWINVER=${GGML_WIN_VER}) TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32) endif() diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index 425a25895..a29a1e883 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -1208,9 +1208,8 @@ if (GGML_CUDA) add_compile_options("$<$:${CUDA_FLAGS}>") endif() -if (MINGW) - # Target Windows 8 for PrefetchVirtualMemory - add_compile_definitions(_WIN32_WINNT=${GGML_WIN_VER}) +if (WIN32) + add_compile_definitions(-D_WIN32_WINNT=${GGML_WIN_VER} -DWINVER=${GGML_WIN_VER}) endif() #