From 7a5bda63611bfd5f6fed80b4b5f9994c4870423a Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Wed, 14 Sep 2022 19:39:17 -0700 Subject: [PATCH 1/2] Attempt to remove too-new CMake builtins --- CMakeLists.txt | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee03addb3..f5f92319f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ SET(hiredis_sources SET(hiredis_sources ${hiredis_sources}) IF(WIN32) - ADD_COMPILE_DEFINITIONS(_CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_WIN32_LEAN_AND_MEAN") ENDIF() ADD_LIBRARY(hiredis SHARED ${hiredis_sources}) @@ -113,9 +113,12 @@ if (MSVC) INSTALL(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo) - INSTALL(FILES $/$.pdb + INSTALL(FILES $/$${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} - CONFIGURATIONS Debug RelWithDebInfo) + CONFIGURATIONS Debug) + INSTALL(FILES $/$${CMAKE_RELEASE_POSTFIX}.pdb + DESTINATION ${CMAKE_INSTALL_LIBDIR} + CONFIGURATIONS RelWithDebInfo Release) endif() # For NuGet packages @@ -206,9 +209,12 @@ IF(ENABLE_SSL) INSTALL(FILES $ DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo) - INSTALL(FILES $/$.pdb + INSTALL(FILES $/$${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} - CONFIGURATIONS Debug RelWithDebInfo) + CONFIGURATIONS Debug) + INSTALL(FILES $/$${CMAKE_RELEASE_POSTFIX}.pdb + DESTINATION ${CMAKE_INSTALL_LIBDIR} + CONFIGURATIONS RelWithDebInfo Release) endif() INSTALL(FILES hiredis_ssl.h From b7d1322016ec0a1df49d6556e220b95e96abdb37 Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Thu, 15 Sep 2022 07:50:03 -0700 Subject: [PATCH 2/2] Minor touchup --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5f92319f..f70411d6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ SET(hiredis_sources SET(hiredis_sources ${hiredis_sources}) IF(WIN32) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_WIN32_LEAN_AND_MEAN") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_CRT_SECURE_NO_WARNINGS /DWIN32_LEAN_AND_MEAN") ENDIF() ADD_LIBRARY(hiredis SHARED ${hiredis_sources})