From e304a1aa6a19bfbeef72e6e94a552254878938f5 Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Sun, 4 Sep 2022 16:44:59 +0200 Subject: [PATCH 1/3] Changed Windows include to lowercase to enable cross-compilation --- gloo/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gloo/types.h b/gloo/types.h index df71d5422..55d82f9e9 100644 --- a/gloo/types.h +++ b/gloo/types.h @@ -30,7 +30,7 @@ #include "gloo/common/common.h" #ifdef _WIN32 -#include +#include typedef SSIZE_T ssize_t; #endif From c0802b88e0fca971e2f26fa5d4fa32f6ae2dbeac Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Sun, 4 Sep 2022 16:45:46 +0200 Subject: [PATCH 2/3] Changed define for mingw32 --- gloo/rendezvous/file_store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gloo/rendezvous/file_store.cc b/gloo/rendezvous/file_store.cc index 1202e80f0..94ca4c009 100644 --- a/gloo/rendezvous/file_store.cc +++ b/gloo/rendezvous/file_store.cc @@ -37,7 +37,7 @@ FileStore::FileStore(const std::string& path) { } std::string FileStore::realPath(const std::string& path) { -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) std::array buf; auto ret = _fullpath(buf.data(), path.c_str(), buf.size()); #else From 858d28513b0244150f58a4676d9970c558f75626 Mon Sep 17 00:00:00 2001 From: Jesper Stemann Andersen Date: Sun, 4 Sep 2022 16:46:32 +0200 Subject: [PATCH 3/3] Added linking with ws2_32 on WIN32 Required to enable cross-compilation for mingw32 on Linux. --- cmake/Dependencies.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 14cbcb1b0..3d9abb44c 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -5,6 +5,10 @@ set(gloo_hip_DEPENDENCY_LIBS "") # Configure path to modules (for find_package) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/") +if (WIN32) + list(APPEND gloo_DEPENDENCY_LIBS "ws2_32") +endif() + if(USE_REDIS) find_package(hiredis REQUIRED) if(HIREDIS_FOUND)