Skip to content

Commit

Permalink
add wss transport and fix tipc tests when building using cmake on lin…
Browse files Browse the repository at this point in the history
…ux (zeromq#3857)

* Allow CMAKE to generate ws and wss transports
I guess there is little use of just ws transport, so by default
GnuTLS (and libsodium) are enabled

* cmake libzmq including wss transport (ubuntu 19.10 and ubuntu 19.10 + wsl 1.0)
test_security_fails (libsodium assert !?)

* updated relicense

* make external libs gnutls nss sodium optional

* #ifdef WSS classes and functions, build test*ws* only if correct libs are included, warning if libs not present

* make libsodium optional

* cmake fix tests TIPC transport

* clang-format pointed out a wrongly placed #ifdef

* GnuTLS before 3.6.7 is not safe

* msvc doesn't agree with strlen in array declaration, test_socks now at least compiles on windows

* windows: libsodium build fails, missing include dirs set by env var

* ws transport test only works when GnuTLS is found

* Fixed condition to use NSS / built in SHA1, so that test_ws_transport should now pass, also when GnuTLS is not found
  • Loading branch information
grmt authored Apr 13, 2020
1 parent 7276b68 commit 718ad8a
Show file tree
Hide file tree
Showing 22 changed files with 1,261 additions and 1,139 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ build/
builds/android/prefix
## IntelliJ
.idea/
## Visual Code
.vscode/
## other results-like folders
bin/
lib/
Expand Down
1,513 changes: 795 additions & 718 deletions CMakeLists.txt

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions RELICENSE/grmt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Permission to Relicense under MPLv2

This is a statement by grmt.
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).

A portion of the commits made by the Github handle "grmt", with
commit author "grmt", are copyright of grmt.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.

grmt ([email protected])
2020/05/04
4 changes: 2 additions & 2 deletions builds/cmake/Modules/FindSodium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
################################################################################

if (NOT MSVC)
include(FindPkgConfig)
find_package(PkgConfig REQUIRED)
pkg_check_modules(PC_SODIUM "libsodium")
if (PC_SODIUM_FOUND)
set(pkg_config_names_private "${pkg_config_names_private} libsodium")
Expand Down Expand Up @@ -39,7 +39,7 @@ find_library(
)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SODIUM DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS)
find_package_handle_standard_args(sodium DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS)
mark_as_advanced(SODIUM_FOUND SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS)

################################################################################
Expand Down
5 changes: 5 additions & 0 deletions builds/cmake/platform.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,19 @@
#cmakedefine ZMQ_USE_BUILTIN_SHA1
#cmakedefine ZMQ_USE_NSS
#cmakedefine ZMQ_HAVE_WS
#cmakedefine ZMQ_HAVE_WSS
#cmakedefine ZMQ_HAVE_TIPC

#cmakedefine ZMQ_HAVE_OPENPGM
#cmakedefine ZMQ_MAKE_VALGRIND_HAPPY

#cmakedefine ZMQ_BUILD_DRAFT_API
#cmakedefine ZMQ_HAVE_CURVE
#cmakedefine ZMQ_USE_TWEETNACL
#cmakedefine ZMQ_USE_LIBSODIUM
#cmakedefine SODIUM_STATIC
#cmakedefine ZMQ_USE_GNUTLS
#cmakedefine ZMQ_USE_RADIX_TREE

#ifdef _AIX
#define ZMQ_HAVE_AIX
Expand Down
2 changes: 1 addition & 1 deletion packaging/nuget/package.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- These values are populated into the package.gsl templates by package.bat. -->
<!-- The target attribute controls path and file name only, id controls package naming. -->
<package id="libzmq-vc120" target="libzmq" version = "4.2.3.0" pathversion="4_2_3_0" platformtoolset="v120">
<package id="libzmq-vc142" target="libzmq" version = "4.2.3.0" pathversion="4_2_3_0" platformtoolset="v142">
<!--<dependency id="libsodium_vc120" version="1.0.12.0" />-->
</package>
196 changes: 98 additions & 98 deletions packaging/nuget/package.nuspec
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>libzmq-vc120</id>
<version>4.2.3.0</version>
<title>libzmq-vc120</title>
<authors>libzmq contributors</authors>
<owners>Eric Voskuil</owners>
<licenseUrl>https://raw.github.com/zeromq/libzmq/master/COPYING.LESSER</licenseUrl>
<projectUrl>https://github.com/zeromq/libzmq</projectUrl>
<iconUrl>https://avatars1.githubusercontent.com/u/109777?s=32</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<developmentDependency>false</developmentDependency>
<description>The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.</description>
<summary>The 0MQ lightweight messaging kernel, with tweetnacl integrated, packaged for specific Visual Studio compiler.</summary>
<releaseNotes>https://raw.github.com/zeromq/libzmq/master/NEWS</releaseNotes>
<copyright>GNU Lesser GPL v3</copyright>
<tags>native, libzmq, zmq, 0MQ, messaging, sockets, C++</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<!-- include -->
<file src="..\..\include\*.h" target="build\native\include" />
<file src="..\..\builds\msvc\platform.hpp" target="build\native\include" />

<!-- targets -->
<file src="package.targets" target="build\native\libzmq-vc120.targets" />
<file src="package.xml" target="build\native\package.xml" />
<!-- docs -->
<!-- Documents (.*) -->
<!--<file src="..\..\docs\*" target="build\native\docs" />-->
<!-- libraries -->

<!-- x86 Dynamic libraries (.dll) -->
<file src="..\..\bin\Win32\Release\v120\dynamic\libzmq.dll" target="build\native\bin\libzmq-x86-v120-mt-4_2_3_0.dll" />
<file src="..\..\bin\Win32\Debug\v120\dynamic\libzmq.dll" target="build\native\bin\libzmq-x86-v120-mt-gd-4_2_3_0.dll" />

<!-- x86 Debugging symbols (.pdb) -->
<!--<file src="..\..\bin\Win32\Release\v120\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x86-v120-mt-4_2_3_0.pdb" />-->
<file src="..\..\bin\Win32\Debug\v120\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x86-v120-mt-gd-4_2_3_0.pdb" />

<!-- x86 Import libraries (.imp.lib) -->
<file src="..\..\bin\Win32\Release\v120\dynamic\libzmq.lib" target="build\native\bin\libzmq-x86-v120-mt-4_2_3_0.imp.lib" />
<file src="..\..\bin\Win32\Debug\v120\dynamic\libzmq.lib" target="build\native\bin\libzmq-x86-v120-mt-gd-4_2_3_0.imp.lib" />

<!-- x86 Export libraries (.exp) -->
<file src="..\..\bin\Win32\Release\v120\dynamic\libzmq.exp" target="build\native\bin\libzmq-x86-v120-mt-4_2_3_0.exp" />
<file src="..\..\bin\Win32\Debug\v120\dynamic\libzmq.exp" target="build\native\bin\libzmq-x86-v120-mt-gd-4_2_3_0.exp" />

<!-- x86 Static libraries (.lib) -->
<file src="..\..\bin\Win32\Release\v120\static\libzmq.lib" target="build\native\bin\libzmq-x86-v120-mt-s-4_2_3_0.lib" />
<file src="..\..\bin\Win32\Debug\v120\static\libzmq.lib" target="build\native\bin\libzmq-x86-v120-mt-sgd-4_2_3_0.lib" />

<!-- x86 Static link time code generation libraries (.ltcg.lib) -->
<file src="..\..\bin\Win32\Release\v120\ltcg\libzmq.lib" target="build\native\bin\libzmq-x86-v120-mt-s-4_2_3_0.ltcg.lib" />
<file src="..\..\bin\Win32\Debug\v120\ltcg\libzmq.lib" target="build\native\bin\libzmq-x86-v120-mt-sgd-4_2_3_0.ltcg.lib" />

<!-- x64 Dynamic libraries (.dll) -->
<file src="..\..\bin\x64\Release\v120\dynamic\libzmq.dll" target="build\native\bin\libzmq-x64-v120-mt-4_2_3_0.dll" />
<file src="..\..\bin\x64\Debug\v120\dynamic\libzmq.dll" target="build\native\bin\libzmq-x64-v120-mt-gd-4_2_3_0.dll" />

<!-- x64 Debugging symbols (.pdb) -->
<!--<file src="..\..\bin\x64\Release\v120\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x64-v120-mt-4_2_3_0.pdb" />-->
<file src="..\..\bin\x64\Debug\v120\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x64-v120-mt-gd-4_2_3_0.pdb" />

<!-- x64 Import libraries (.imp.lib) -->
<file src="..\..\bin\x64\Release\v120\dynamic\libzmq.lib" target="build\native\bin\libzmq-x64-v120-mt-4_2_3_0.imp.lib" />
<file src="..\..\bin\x64\Debug\v120\dynamic\libzmq.lib" target="build\native\bin\libzmq-x64-v120-mt-gd-4_2_3_0.imp.lib" />

<!-- x64 Export libraries (.exp) -->
<file src="..\..\bin\x64\Release\v120\dynamic\libzmq.exp" target="build\native\bin\libzmq-x64-v120-mt-4_2_3_0.exp" />
<file src="..\..\bin\x64\Debug\v120\dynamic\libzmq.exp" target="build\native\bin\libzmq-x64-v120-mt-gd-4_2_3_0.exp" />

<!-- x64 Static libraries (.lib) -->
<file src="..\..\bin\x64\Release\v120\static\libzmq.lib" target="build\native\bin\libzmq-x64-v120-mt-s-4_2_3_0.lib" />
<file src="..\..\bin\x64\Debug\v120\static\libzmq.lib" target="build\native\bin\libzmq-x64-v120-mt-sgd-4_2_3_0.lib" />

<!-- x64 Static link time code generation libraries (.ltcg.lib) -->
<file src="..\..\bin\Win32\Release\v120\ltcg\libzmq.lib" target="build\native\bin\libzmq-x64-v120-mt-s-4_2_3_0.ltcg.lib" />
<file src="..\..\bin\Win32\Debug\v120\ltcg\libzmq.lib" target="build\native\bin\libzmq-x64-v120-mt-sgd-4_2_3_0.ltcg.lib" />
</files>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
</package>
<?xml version="1.0" encoding="utf-8"?>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
<metadata minClientVersion="2.5">
<id>libzmq-vc142</id>
<version>4.2.3.0</version>
<title>libzmq-vc142</title>
<authors>libzmq contributors</authors>
<owners>Eric Voskuil</owners>
<licenseUrl>https://raw.github.com/zeromq/libzmq/master/COPYING.LESSER</licenseUrl>
<projectUrl>https://github.com/zeromq/libzmq</projectUrl>
<iconUrl>https://avatars1.githubusercontent.com/u/109777?s=32</iconUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<developmentDependency>false</developmentDependency>
<description>The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. 0MQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.</description>
<summary>The 0MQ lightweight messaging kernel, with tweetnacl integrated, packaged for specific Visual Studio compiler.</summary>
<releaseNotes>https://raw.github.com/zeromq/libzmq/master/NEWS</releaseNotes>
<copyright>GNU Lesser GPL v3</copyright>
<tags>native, libzmq, zmq, 0MQ, messaging, sockets, C++</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<!-- include -->

<file src="..\..\include\*.h" target="build\native\include" />
<file src="..\..\builds\msvc\platform.hpp" target="build\native\include" />

<!-- targets -->

<file src="package.targets" target="build\native\libzmq-vc142.targets" />
<file src="package.xml" target="build\native\package.xml" />

<!-- docs -->

<!-- Documents (.*) -->
<!--<file src="..\..\docs\*" target="build\native\docs" />-->

<!-- libraries -->

<!-- x86 Dynamic libraries (.dll) -->
<file src="..\..\bin\Win32\Release\v142\dynamic\libzmq.dll" target="build\native\bin\libzmq-x86-v142-mt-4_2_3_0.dll" />
<file src="..\..\bin\Win32\Debug\v142\dynamic\libzmq.dll" target="build\native\bin\libzmq-x86-v142-mt-gd-4_2_3_0.dll" />

<!-- x86 Debugging symbols (.pdb) -->
<!--<file src="..\..\bin\Win32\Release\v142\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x86-v142-mt-4_2_3_0.pdb" />-->
<file src="..\..\bin\Win32\Debug\v142\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x86-v142-mt-gd-4_2_3_0.pdb" />

<!-- x86 Import libraries (.imp.lib) -->
<file src="..\..\bin\Win32\Release\v142\dynamic\libzmq.lib" target="build\native\bin\libzmq-x86-v142-mt-4_2_3_0.imp.lib" />
<file src="..\..\bin\Win32\Debug\v142\dynamic\libzmq.lib" target="build\native\bin\libzmq-x86-v142-mt-gd-4_2_3_0.imp.lib" />

<!-- x86 Export libraries (.exp) -->
<file src="..\..\bin\Win32\Release\v142\dynamic\libzmq.exp" target="build\native\bin\libzmq-x86-v142-mt-4_2_3_0.exp" />
<file src="..\..\bin\Win32\Debug\v142\dynamic\libzmq.exp" target="build\native\bin\libzmq-x86-v142-mt-gd-4_2_3_0.exp" />

<!-- x86 Static libraries (.lib) -->
<file src="..\..\bin\Win32\Release\v142\static\libzmq.lib" target="build\native\bin\libzmq-x86-v142-mt-s-4_2_3_0.lib" />
<file src="..\..\bin\Win32\Debug\v142\static\libzmq.lib" target="build\native\bin\libzmq-x86-v142-mt-sgd-4_2_3_0.lib" />

<!-- x86 Static link time code generation libraries (.ltcg.lib) -->
<file src="..\..\bin\Win32\Release\v142\ltcg\libzmq.lib" target="build\native\bin\libzmq-x86-v142-mt-s-4_2_3_0.ltcg.lib" />
<file src="..\..\bin\Win32\Debug\v142\ltcg\libzmq.lib" target="build\native\bin\libzmq-x86-v142-mt-sgd-4_2_3_0.ltcg.lib" />

<!-- x64 Dynamic libraries (.dll) -->
<file src="..\..\bin\x64\Release\v142\dynamic\libzmq.dll" target="build\native\bin\libzmq-x64-v142-mt-4_2_3_0.dll" />
<file src="..\..\bin\x64\Debug\v142\dynamic\libzmq.dll" target="build\native\bin\libzmq-x64-v142-mt-gd-4_2_3_0.dll" />

<!-- x64 Debugging symbols (.pdb) -->
<!--<file src="..\..\bin\x64\Release\v142\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x64-v142-mt-4_2_3_0.pdb" />-->
<file src="..\..\bin\x64\Debug\v142\dynamic\libzmq.pdb" target="build\native\bin\libzmq-x64-v142-mt-gd-4_2_3_0.pdb" />

<!-- x64 Import libraries (.imp.lib) -->
<file src="..\..\bin\x64\Release\v142\dynamic\libzmq.lib" target="build\native\bin\libzmq-x64-v142-mt-4_2_3_0.imp.lib" />
<file src="..\..\bin\x64\Debug\v142\dynamic\libzmq.lib" target="build\native\bin\libzmq-x64-v142-mt-gd-4_2_3_0.imp.lib" />

<!-- x64 Export libraries (.exp) -->
<file src="..\..\bin\x64\Release\v142\dynamic\libzmq.exp" target="build\native\bin\libzmq-x64-v142-mt-4_2_3_0.exp" />
<file src="..\..\bin\x64\Debug\v142\dynamic\libzmq.exp" target="build\native\bin\libzmq-x64-v142-mt-gd-4_2_3_0.exp" />

<!-- x64 Static libraries (.lib) -->
<file src="..\..\bin\x64\Release\v142\static\libzmq.lib" target="build\native\bin\libzmq-x64-v142-mt-s-4_2_3_0.lib" />
<file src="..\..\bin\x64\Debug\v142\static\libzmq.lib" target="build\native\bin\libzmq-x64-v142-mt-sgd-4_2_3_0.lib" />

<!-- x64 Static link time code generation libraries (.ltcg.lib) -->
<file src="..\..\bin\Win32\Release\v142\ltcg\libzmq.lib" target="build\native\bin\libzmq-x64-v142-mt-s-4_2_3_0.ltcg.lib" />
<file src="..\..\bin\Win32\Debug\v142\ltcg\libzmq.lib" target="build\native\bin\libzmq-x64-v142-mt-sgd-4_2_3_0.ltcg.lib" />
</files>
<!--
#################################################################
# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY #
#################################################################
-->
</package>
Loading

0 comments on commit 718ad8a

Please sign in to comment.