Skip to content

Commit f02a862

Browse files
committed
feat(CMakeLists): Add MSVC warning flags for ggml modules
Add MSVC warning flags to improve code quality and catch potential issues early. The following flags have been added: - /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
1 parent 08dfb6c commit f02a862

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ggml/src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if (GGML_ALL_WARNINGS)
7474

7575
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${C_FLAGS};${GF_C_FLAGS}>"
7676
"$<$<COMPILE_LANGUAGE:CXX>:${CXX_FLAGS};${GF_CXX_FLAGS}>")
77-
else()
77+
elseif(MSVC)
7878
# MSVC
7979
list(APPEND MSVC_WARNING_FLAGS
8080
/W4 # Comprehensive warnings (similar to -Wall and some of -Wextra)
@@ -86,6 +86,9 @@ if (GGML_ALL_WARNINGS)
8686
)
8787

8888
add_compile_options(${MSVC_WARNING_FLAGS})
89+
else()
90+
set(C_FLAGS "")
91+
set(CXX_FLAGS "")
8992
endif()
9093
endif()
9194

0 commit comments

Comments
 (0)