File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,52 @@ if (MSVC)
182182 set (HWY_FLAGS
183183 # fix build error C1128 in blockwise*_test & arithmetic_test
184184 /bigobj
185+
186+ # Warnings
187+ /W4
188+ # Disable some W4 warnings. Enable them individually after they are cleaned up.
189+ /wd4100
190+ /wd4127
191+ /wd4324
192+ /wd4456
193+ /wd4701
194+ /wd4702
195+ /wd4723
196+
197+ # CMake automatically adds exception handling flags. Remove them.
198+ /GR-
199+ /EHs-c-
200+ # Disable exceptions in STL code.
201+ -D_HAS_EXCEPTIONS=0
185202 )
203+
204+ # This adds extra warnings for the clang-cl compiler on Windows.
205+ # This is the same as the sections in the else part.
206+ # These could be refactored.
207+ if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" )
208+ list (APPEND HWY_FLAGS
209+ # These are not included in Wall nor Wextra:
210+ -Wconversion
211+ -Wsign-conversion
212+ -Wvla
213+ -Wnon-virtual-dtor
214+
215+ -Wfloat-overflow-conversion
216+ -Wfloat-zero-conversion
217+ -Wfor-loop-analysis
218+ -Wgnu-redeclared-enum
219+ -Winfinite-recursion
220+ -Wself-assign
221+ -Wstring-conversion
222+ -Wtautological-overlap-compare
223+ -Wthread-safety-analysis
224+ -Wundefined-func-template
225+ )
226+ endif ()
227+
228+ if (HWY_WARNINGS_ARE_ERRORS)
229+ list (APPEND HWY_FLAGS /WX)
230+ endif ()
186231else ()
187232 set (HWY_FLAGS
188233 # Avoid changing binaries based on the current time and date.
You can’t perform that action at this time.
0 commit comments