From 2c4e5364aab60e3fb92c674319208c80e39224da Mon Sep 17 00:00:00 2001 From: Iban Cereijo Date: Wed, 14 Jun 2017 15:54:03 +0200 Subject: [PATCH 1/2] Problem: missing Ws2_32.lib when cross compiling Solution: use lower case ws2_32.lib to enable cross compilation from platforms with case-sensitive filesystems. When cross compiling the tests with Mingw-w64, CMake cannot locate Ws2_32.lib --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bb292873..c934ca09 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -134,7 +134,7 @@ if(WIN32) add_definitions(-DZMQ_CUSTOM_PLATFORM_HPP) add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) # Same name on 64bit systems - link_libraries(Ws2_32.lib) + link_libraries(ws2_32.lib) endif() # add library and include dirs for all targets From d040dc18b5e425546d204615866018c374c976e5 Mon Sep 17 00:00:00 2001 From: Iban Cereijo Date: Wed, 14 Jun 2017 15:55:29 +0200 Subject: [PATCH 2/2] Problem: CMake evaluation fails with Mingw-w64 Solution: we can use 'CMAKE_SYSTEM_VERSION' instead of '${CMAKE_SYSTEM_VERSION}' for the 'if' clauses. CMake fails to evaluate condition when CMAKE_SYSTEM_VERSION is empty, which can happen with a default installation of Mingw-w64 in Linux. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7064582d..9bbbfc47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,7 +183,7 @@ include (CheckCXXSymbolExists) check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS) check_include_files (windows.h ZMQ_HAVE_WINDOWS) -if( ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore" AND ${CMAKE_SYSTEM_VERSION} STREQUAL "10.0") +if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0") SET(ZMQ_HAVE_WINDOWS_UWP ON) ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) endif()