if (WHISPER_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
+
+if (MSVC)
+ set(MSVC_WARNING_FLAGS
+ /wd4101 # Unreferenced local variable
+ /wd4005 # Macro redefinition
+ /wd4065 # switch statement contains 'default' but no 'case' labels
+ /wd4267 # Conversion from 'size_t' to a smaller type, possible loss of data
+ /wd4244 # Conversion from one type to another type, possible loss of ata
+ /wd4805 # Unsafe mix of type
+ /wd4305 # Truncation from 'type1' to 'type2' (often double to float)
+ /wd4996 # Function or variable may be unsafe/deprecated
+ )
+ function(disable_msvc_warnings target_name)
+ target_compile_options(${target_name} PRIVATE ${MSVC_WARNING_FLAGS})
+ endfunction()
+
+ if (WHISPER_BUILD_EXAMPLES)
+ disable_msvc_warnings(common)
+ disable_msvc_warnings(common-sdl)
+ disable_msvc_warnings(lsp)
+ disable_msvc_warnings(wchess-core)
+ disable_msvc_warnings(whisper-command)
+ disable_msvc_warnings(whisper-cli)
+ disable_msvc_warnings(whisper-server)
+ disable_msvc_warnings(whisper-stream)
+ disable_msvc_warnings(whisper-talk-llama)
+ disable_msvc_warnings(whisper-bench)
+ disable_msvc_warnings(quantize)
+ endif()
+endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ggml-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/ggml-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ggml)
+
+if (MSVC)
+ set(MSVC_WARNING_FLAGS
+ /wd4005 # Macro redefinition
+ /wd4244 # Conversion from one type to another type, possible loss of data
+ /wd4267 # Conversion from 'size_t' to a smaller type, possible loss of data
+ )
+ function(disable_msvc_warnings target_name)
+ target_compile_options(${target_name} PRIVATE ${MSVC_WARNING_FLAGS})
+ endfunction()
+
+ disable_msvc_warnings(ggml-base)
+ disable_msvc_warnings(ggml)
+ disable_msvc_warnings(ggml-cpu)
+endif()