Skip to content

Commit 08dfb6c

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 5e43f10 commit 08dfb6c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ggml/src/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,17 @@ if (GGML_ALL_WARNINGS)
7575
add_compile_options("$<$<COMPILE_LANGUAGE:C>:${C_FLAGS};${GF_C_FLAGS}>"
7676
"$<$<COMPILE_LANGUAGE:CXX>:${CXX_FLAGS};${GF_CXX_FLAGS}>")
7777
else()
78-
# todo : msvc
79-
set(C_FLAGS "")
80-
set(CXX_FLAGS "")
78+
# MSVC
79+
list(APPEND MSVC_WARNING_FLAGS
80+
/W4 # Comprehensive warnings (similar to -Wall and some of -Wextra)
81+
/we4456 # declaration hides previous local declaration
82+
/we4457 # declaration hides function parameter
83+
/we4458 # declaration hides class member
84+
/wd4100 # unreferenced formal parameter (too noisy)
85+
/wd4324 # structure was padded due to alignment specifier
86+
)
87+
88+
add_compile_options(${MSVC_WARNING_FLAGS})
8189
endif()
8290
endif()
8391

0 commit comments

Comments
 (0)