cmake: move _WIN32_WINNT definitions to root
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e6443a..8e8ee3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -263,6 +263,11 @@ ELSE ()
ENDIF ()
ENDIF()
+# Ensure that MinGW provides the correct header files.
+IF (WIN32 AND NOT CYGWIN)
+ ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0600)
+ENDIF()
+
IF( NOT CMAKE_CONFIGURATION_TYPES )
# Build Debug by default
IF (NOT CMAKE_BUILD_TYPE)
diff --git a/fuzzers/CMakeLists.txt b/fuzzers/CMakeLists.txt
index 6d042d9..59eca24 100644
--- a/fuzzers/CMakeLists.txt
+++ b/fuzzers/CMakeLists.txt
@@ -1,8 +1,3 @@
-# Ensure that MinGW provides the correct header files.
-IF (WIN32 AND NOT CYGWIN)
- ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0600)
-ENDIF()
-
LINK_DIRECTORIES(${LIBGIT2_LIBDIRS})
INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDES})
INCLUDE_DIRECTORIES(SYSTEM ${LIBGIT2_SYSTEM_INCLUDES})
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 750085b..de7e408 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -299,8 +299,6 @@ FILE(GLOB SRC_H
# On Windows use specific platform sources
IF (WIN32 AND NOT CYGWIN)
- ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0600)
-
IF(MSVC)
SET(WIN_RC "win32/git2.rc")
ENDIF()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4589d81..a97e8fe 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -14,11 +14,6 @@ ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
# Ensure that we do not use deprecated functions internally
ADD_DEFINITIONS(-DGIT_DEPRECATE_HARD)
-# Ensure that MinGW provides the correct header files.
-IF (WIN32 AND NOT CYGWIN)
- ADD_DEFINITIONS(-DWIN32 -D_WIN32_WINNT=0x0600)
-ENDIF()
-
INCLUDE_DIRECTORIES(${CLAR_PATH} ${libgit2_BINARY_DIR}/src)
FILE(GLOB_RECURSE SRC_TEST ${CLAR_PATH}/*/*.c ${CLAR_PATH}/*/*.h)
SET(SRC_CLAR "main.c" "clar_libgit2.c" "clar_libgit2_trace.c" "clar_libgit2_timer.c" "clar.c")