diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index fcb354e16bc2e..b6e014c1ded45 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -74,8 +74,19 @@ if (GGML_ALL_WARNINGS) add_compile_options("$<$:${C_FLAGS};${GF_C_FLAGS}>" "$<$:${CXX_FLAGS};${GF_CXX_FLAGS}>") + elseif(MSVC) + # MSVC + list(APPEND MSVC_WARNING_FLAGS + /W4 # Comprehensive warnings (similar to -Wall and some of -Wextra) + /we4456 # declaration hides previous local declaration + /we4457 # declaration hides function parameter + /we4458 # declaration hides class member + /wd4100 # unreferenced formal parameter (too noisy) + /wd4324 # structure was padded due to alignment specifier + ) + + add_compile_options(${MSVC_WARNING_FLAGS}) else() - # todo : msvc set(C_FLAGS "") set(CXX_FLAGS "") endif()