changeset 110:22f3170c2791

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Nov 2016 11:15:41 +0100
parents 045e251f9c4d
children 6d25076dddf0
files Resources/CMake/PostgreSQLConfiguration.cmake
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Resources/CMake/PostgreSQLConfiguration.cmake	Tue Nov 08 10:07:23 2016 +0100
+++ b/Resources/CMake/PostgreSQLConfiguration.cmake	Tue Nov 08 11:15:41 2016 +0100
@@ -154,16 +154,17 @@
       ${PQ_SOURCES_DIR}/src/port/pgsleep.c
       ${PQ_SOURCES_DIR}/src/port/snprintf.c
       ${PQ_SOURCES_DIR}/src/port/system.c 
-      ${PQ_SOURCES_DIR}/src/port/win32error.c
       ${PQ_SOURCES_DIR}/src/port/win32setlocale.c
       ${PQ_SOURCES_DIR}/src/port/getaddrinfo.c
       )
       
-    if (${CMAKE_COMPILER_IS_GNUCXX})
+    if (CMAKE_COMPILER_IS_GNUCXX OR 
+        (MSVC AND MSVC_VERSION GREATER 1800))
+      # Starting Visual Studio 2013 (version 1800), it is necessary to also add "win32error.c"
       LIST(APPEND LIBPQ_SOURCES ${PQ_SOURCES_DIR}/src/port/win32error.c)
     endif()
 
-    if (${MSVC})
+    if (MSVC)
       LIST(APPEND LIBPQ_SOURCES ${PQ_SOURCES_DIR}/src/interfaces/libpq/pthread-win32.c)
     endif()
   endif()