CMake corrections for building on Windows (#1122)
* Replace use of newer CMake builtins than in v3.0.0 Visual Studio generator will replace -D with /D. * Only use /Z7 flag on a Visual Studio compilator Flag is not available on a GNU compilator running on windows, like in a mingw64 setup.
This commit is contained in:
parent
9c338a5981
commit
c245df9fb9
@ -41,7 +41,7 @@ SET(hiredis_sources
|
|||||||
SET(hiredis_sources ${hiredis_sources})
|
SET(hiredis_sources ${hiredis_sources})
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ADD_LIBRARY(hiredis SHARED ${hiredis_sources})
|
ADD_LIBRARY(hiredis SHARED ${hiredis_sources})
|
||||||
@ -57,7 +57,7 @@ ENDIF()
|
|||||||
SET_TARGET_PROPERTIES(hiredis
|
SET_TARGET_PROPERTIES(hiredis
|
||||||
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
||||||
VERSION "${HIREDIS_SONAME}")
|
VERSION "${HIREDIS_SONAME}")
|
||||||
IF(WIN32)
|
IF(MSVC)
|
||||||
SET_TARGET_PROPERTIES(hiredis_static
|
SET_TARGET_PROPERTIES(hiredis_static
|
||||||
PROPERTIES COMPILE_FLAGS /Z7)
|
PROPERTIES COMPILE_FLAGS /Z7)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@ -178,7 +178,7 @@ IF(ENABLE_SSL)
|
|||||||
PROPERTIES
|
PROPERTIES
|
||||||
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
WINDOWS_EXPORT_ALL_SYMBOLS TRUE
|
||||||
VERSION "${HIREDIS_SONAME}")
|
VERSION "${HIREDIS_SONAME}")
|
||||||
IF(WIN32)
|
IF(MSVC)
|
||||||
SET_TARGET_PROPERTIES(hiredis_ssl_static
|
SET_TARGET_PROPERTIES(hiredis_ssl_static
|
||||||
PROPERTIES COMPILE_FLAGS /Z7)
|
PROPERTIES COMPILE_FLAGS /Z7)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user