os: ubuntu-18.04
CC: i686-w64-mingw32-gcc-posix
CXX: i686-w64-mingw32-g++-posix
- CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DCMAKE_SYSTEM_NAME=Windows -DZSTD_FROM_INTERNET=ON -DREDIS_STORAGE_BACKEND=OFF
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DCMAKE_SYSTEM_NAME=Windows -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
RUN_TESTS: none
apt_get: elfutils mingw-w64
CC: x86_64-w64-mingw32-gcc-posix
CXX: x86_64-w64-mingw32-g++-posix
ENABLE_CACHE_CLEANUP_TESTS: 1
- CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DCMAKE_SYSTEM_NAME=Windows -DZSTD_FROM_INTERNET=ON -DREDIS_STORAGE_BACKEND=OFF
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DCMAKE_SYSTEM_NAME=Windows -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
RUN_TESTS: unittest-in-wine
apt_get: elfutils mingw-w64 wine
CXX: cl
ENABLE_CACHE_CLEANUP_TESTS: 1
CMAKE_GENERATOR: Ninja
- CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DREDIS_STORAGE_BACKEND=OFF
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
TEST_CC: clang -target i686-pc-windows-msvc
- name: Windows VS2019 64-bit
CXX: cl
ENABLE_CACHE_CLEANUP_TESTS: 1
CMAKE_GENERATOR: Ninja
- CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DREDIS_STORAGE_BACKEND=OFF
+ CMAKE_PARAMS: -DCMAKE_BUILD_TYPE=CI -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON
TEST_CC: clang -target x86_64-pc-windows-msvc
- name: Clang address & UB sanitizer
)
add_library(libhiredis_static STATIC EXCLUDE_FROM_ALL ${hiredis_sources})
add_library(HIREDIS::HIREDIS ALIAS libhiredis_static)
+ if(WIN32)
+ target_compile_definitions(libhiredis_static PRIVATE _CRT_SECURE_NO_WARNINGS)
+ target_link_libraries(libhiredis_static PUBLIC ws2_32)
+ endif()
+
make_directory("${hiredis_dir}/include")
make_directory("${hiredis_dir}/include/hiredis")
file(GLOB hiredis_headers "${hiredis_dir}/*.h")
# ifdef _MSC_VER
typedef unsigned __int32 mode_t;
typedef int pid_t;
-# ifdef _WIN64
-typedef __int64 ssize_t;
-# else
-typedef int ssize_t;
-# endif
-# elif !defined(__MINGW32__)
-typedef __int64 ssize_t;
# endif // _MSC_VER
#endif // _WIN32
#include <util/expected.hpp>
#include <util/string.hpp>
+// Ignore "ISO C++ forbids flexible array member ‘buf’" warning from -Wpedantic.
#ifdef __GNUC__
# pragma GCC diagnostic push
-// Ignore "ISO C++ forbids flexible array member ‘buf’" warning from -Wpedantic.
# pragma GCC diagnostic ignored "-Wpedantic"
#endif
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable : 4200)
+#endif
#include <hiredis/hiredis.h>
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif