Commit cc9e47c9 by Edward Thomson

win32: support upgrading warnings to errors (/WX)

For MSVC, support warnings as errors by providing the /WX compiler
flags.  (/WX is the moral equivalent of -Werror.)

Disable warnings as errors ass part of xdiff, since it contains
warnings.  But as a component of git itself, we want to avoid skew and
keep our implementation as similar as possible to theirs.  We'll work
with upstream to fix these issues, but in the meantime, simply let those
continue to warn.
parent f6530438
......@@ -7,5 +7,9 @@ MACRO(DISABLE_WARNINGS flag)
ENDMACRO()
IF(ENABLE_WERROR)
ADD_C_FLAG_IF_SUPPORTED(-Werror)
IF(MSVC)
ADD_COMPILE_OPTIONS(-WX)
ELSE()
ADD_C_FLAG_IF_SUPPORTED(-Werror)
ENDIF()
ENDIF()
......@@ -314,12 +314,20 @@ ELSE()
ENDIF()
FILE(GLOB SRC_OS unix/*.c unix/*.h)
ENDIF()
FILE(GLOB SRC_GIT2 *.c *.h
allocators/*.c allocators/*.h
streams/*.c streams/*.h
transports/*.c transports/*.h
xdiff/*.c xdiff/*.h)
# the xdiff dependency is not (yet) warning-free, disable warnings as
# errors for the xdiff sources until we've sorted them out
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(xdiff/xdiffi.c PROPERTIES COMPILE_FLAGS -WX-)
SET_SOURCE_FILES_PROPERTIES(xdiff/xutils.c PROPERTIES COMPILE_FLAGS -WX-)
ENDIF()
# Determine architecture of the machine
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(GIT_ARCH_64 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment