From: Georgi Gerganov Date: Sat, 29 Oct 2022 16:41:50 +0000 (+0300) Subject: ref #5 : update CMake for Windows build X-Git-Tag: upstream/1.7.4~1876 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=234f414652e85d62706a824c967d5300f7c1304d;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp ref #5 : update CMake for Windows build - __AVX2__ should already be defined due to /arch:AVX2 - _CRT_SECURE_NO_WARNINGS should be defined both for shared and static lib --- diff --git a/CMakeLists.txt b/CMakeLists.txt index cb03af95..7dbc476e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,9 +167,11 @@ target_include_directories(${TARGET} PUBLIC ) if (MSVC) - target_link_libraries(${TARGET} PRIVATE ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(${TARGET} PRIVATE ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + + set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -D_CRT_SECURE_NO_WARNINGS) else() - target_link_libraries(${TARGET} PRIVATE m ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(${TARGET} PRIVATE m ${WHISPER_EXTRA_LIBS} ${CMAKE_THREAD_LIBS_INIT}) endif() if (BUILD_SHARED_LIBS) @@ -180,10 +182,6 @@ if (BUILD_SHARED_LIBS) target_compile_definitions(${TARGET} PUBLIC WHISPER_SHARED ) - - if (MSVC) - target_compile_definitions(${TARGET} PUBLIC __AVX2__ _CRT_SECURE_NO_WARNINGS) - endif() endif() target_compile_definitions(${TARGET} PUBLIC