From: Kreijstal Date: Tue, 12 Dec 2023 11:35:00 +0000 (+0100) Subject: cmake : target windows 8 or above for prefetchVirtualMemory in llama-talk (#1617) X-Git-Tag: upstream/1.7.4~1206 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ec03661b20c7d8b66348c0a439c3386b996b2b72;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp cmake : target windows 8 or above for prefetchVirtualMemory in llama-talk (#1617) Since we use prefetchVirtualMemory we specify we target win 8 or above, otherwise other compilers will refuse to use the prefetchVirtualMemory api, (I understand you are loading it dynamically but the header definition has this limitation) --- diff --git a/examples/talk-llama/CMakeLists.txt b/examples/talk-llama/CMakeLists.txt index 8478a13c..0b347f6a 100644 --- a/examples/talk-llama/CMakeLists.txt +++ b/examples/talk-llama/CMakeLists.txt @@ -18,6 +18,11 @@ if (WHISPER_SDL2) ../../ggml-quants.c ../../whisper.cpp) + if(WIN32) + # It requires Windows 8.1 or later for PrefetchVirtualMemory + target_compile_definitions(${TARGET} PRIVATE -D_WIN32_WINNT=0x0602) + endif() + target_include_directories(${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} ../../) target_link_libraries(${TARGET} PRIVATE ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})