From 8ff75343efd30fe94921926914812876ddf93eba 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 cd38c8a93..b8d56a8e6 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 c03b8b07db1066f7991edfb7e5f6631b224ab92b 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 206c38749..f07134087 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 3a4d455a2c5b1f35928d61f46770966d84f10e93 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 2e200e6b5..a7c5e0076 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)