summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Modules/EnableWarnings.cmake6
-rw-r--r--src/CMakeLists.txt8
2 files changed, 13 insertions, 1 deletions
diff --git a/cmake/Modules/EnableWarnings.cmake b/cmake/Modules/EnableWarnings.cmake
index 72e1523c4..b61ed7e90 100644
--- a/cmake/Modules/EnableWarnings.cmake
+++ b/cmake/Modules/EnableWarnings.cmake
@@ -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()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7ab183210..750085b5e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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)