summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2020-02-27 21:29:05 -0800
committerGitHub <noreply@github.com>2020-02-27 21:29:05 -0800
commit38675d23cc3bb45e2dfdeaed3a4a843f698731b3 (patch)
treec00fa09d41ee91d4d42fda4849963a3b175cc32d /CMakeLists.txt
parent3421ac30932eed6d49405dd9b1b7438adc85a68e (diff)
Housekeeping fixes (#764)
Housekeeping * Check for C++ (#758, #750) * Include `alloc.h` in `make install` and `cmake` * Add a `.def` file for Windows (#760) * Include allocation wrappers referenced in adapter headers * Fix minor syntax errors and typos in README * Fix CI in Windows by properly escaping arguments (#761)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 770e1a1..564c138 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ PROJECT(hiredis VERSION "${VERSION}")
SET(ENABLE_EXAMPLES OFF CACHE BOOL "Enable building hiredis examples")
-ADD_LIBRARY(hiredis SHARED
+SET(hiredis_sources
async.c
dict.c
hiredis.c
@@ -33,6 +33,15 @@ ADD_LIBRARY(hiredis SHARED
sockcompat.c
alloc.c)
+IF(WIN32)
+ SET(hiredis_sources
+ ${hiredis_sources}
+ hiredis.def
+ )
+ENDIF()
+
+ADD_LIBRARY(hiredis SHARED ${hiredis_sources})
+
SET_TARGET_PROPERTIES(hiredis
PROPERTIES
VERSION "${HIREDIS_SONAME}")
@@ -46,7 +55,7 @@ CONFIGURE_FILE(hiredis.pc.in hiredis.pc @ONLY)
INSTALL(TARGETS hiredis
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-INSTALL(FILES hiredis.h read.h sds.h async.h
+INSTALL(FILES hiredis.h read.h sds.h async.h alloc.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
INSTALL(DIRECTORY adapters