Skip to content

Commit

Permalink
cmake : target windows 8 or above for prefetchVirtualMemory in llama-…
Browse files Browse the repository at this point in the history
…talk (ggerganov#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)
  • Loading branch information
Kreijstal authored Dec 12, 2023
1 parent 7e61768 commit 03bc26b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/talk-llama/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 03bc26b

Please sign in to comment.