Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/cmake-superbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)
project(azmq-super-build)

#options
Expand All @@ -23,12 +23,17 @@ endif ()

include(ExternalProject)

set(BOOST_177 "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2")
set(BOOST_176 "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2")
set(BOOST_174 "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2")
set(BOOST_172 "https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2")
set(BOOST_170 "https://boostorg.jfrog.io/artifactory/main/release/1.70.0/source/boost_1_70_0.tar.bz2")
set(BOOST_168 "https://boostorg.jfrog.io/artifactory/main/release/1.68.0/source/boost_1_68_0.tar.bz2")

set(BOOST_189 "https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2")
set(BOOST_187 "https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.bz2")
set(BOOST_186 "https://archives.boost.io/release/1.86.0/source/boost_1_86_0.tar.bz2")
set(BOOST_184 "https://archives.boost.io/release/1.84.0/source/boost_1_84_0.tar.bz2")
set(BOOST_177 "https://archives.boost.io/release/1.77.0/source/boost_1_77_0.tar.bz2")
set(BOOST_176 "https://archives.boost.io/release/1.76.0/source/boost_1_76_0.tar.bz2")
set(BOOST_174 "https://archives.boost.io/release/1.74.0/source/boost_1_74_0.tar.bz2")
set(BOOST_172 "https://archives.boost.io/release/1.72.0/source/boost_1_72_0.tar.bz2")
set(BOOST_170 "https://archives.boost.io/release/1.70.0/source/boost_1_70_0.tar.bz2")
set(BOOST_168 "https://archives.boost.io/release/1.68.0/source/boost_1_68_0.tar.bz2")

set(DEVROOT ${CMAKE_BINARY_DIR}/devroot)

Expand Down Expand Up @@ -76,13 +81,19 @@ if (NOT (BOOST_URL STREQUAL "system"))
INSTALL_DIR ${DEVROOT}
CONFIGURE_COMMAND ./bootstrap.sh --prefix=<INSTALL_DIR>
BUILD_COMMAND ""
INSTALL_COMMAND ./b2 install --prefix=<INSTALL_DIR> -j${CPU_COUNT})
INSTALL_COMMAND ./b2 install --prefix=<INSTALL_DIR> -j${CPU_COUNT} --warnings-as-errors=off --without-python --without-math)
list(APPEND LIBS boost)
endif ()

cmake_policy(GET CMP0167 _cmp0167_value)
if(_cmp0167_value)
set(_policy_arg "-DCMAKE_POLICY_DEFAULT_CMP0167=${_cmp0167_value}")
message(STATUS " Setting superbuild CMP0167 to ${_cmp0167_value} ")
endif()

ExternalProject_Add(
azmq
DEPENDS ${LIBS}
CMAKE_ARGS ${CMAKE_ARGS} -D AZMQ_BUILD_TESTS=YES
CMAKE_ARGS ${CMAKE_ARGS} -D AZMQ_BUILD_TESTS=YES ${_policy_arg}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../..
TEST_BEFORE_INSTALL YES)
118 changes: 73 additions & 45 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,103 @@ on:
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu22",
os: ubuntu-22.04,
boost_url: system,
zmq_tag: system,
system_packages: "libboost-all-dev libzmq3-dev ",
cc: "gcc",
cxx: "g++",
}
- {
name: "ubuntu20 stock",
os: ubuntu-20.04,
boost_url: system,
zmq_tag: system,
system_packages: "libboost-all-dev libzmq3-dev ",
cc: "gcc",
cxx: "g++",
}
- {
name: "macos12 ",
os: macos-12,
boost_url: system,
zmq_tag: system,
system_packages: "zmq boost",
cc: "clang",
cxx: "clang++",
}
- {
name: "macos11 ",
os: macos-11,
boost_url: system,
zmq_tag: system,
system_packages: "zmq boost",
cc: "clang",
cxx: "clang++",
}
config:
- os: ubuntu-24.04
cc: gcc
cxx: g++
- os: ubuntu-22.04
cc: gcc
cxx: g++
- os: macos-26
cc: clang
cxx: clang++
- os: macos-15
cc: clang
cxx: clang++
- os: macos-14
cc: clang
cxx: clang++
- os: macos-13
cc: clang
cxx: clang++
boost:
- url: system
system_packages_ubuntu: libboost-all-dev
system_packages_macos: boost
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_189
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_187
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_184
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_176
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_174
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_170
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
- url: BOOST_168
system_packages_ubuntu:
system_packages_macos:
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=OLD
zmq:
- tag: system
system_packages_ubuntu: libzmq3-dev
system_packages_macos: zmq

runs-on: ${{ matrix.config.os }}

env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
CTEST_OUTPUT_ON_FAILURE: 1
PACKAGES: ${{ matrix.config.system_packages }}
PACKAGES_UBUNTU: ${{ matrix.boost.system_packages_ubuntu }} ${{ matrix.zmq.system_packages_ubuntu }}
PACKAGES_MACOS: ${{ matrix.boost.system_packages_macos }} ${{ matrix.zmq.system_packages_macos }}
CONFIG_OS: ${{ matrix.config.os }}
MATRIX: ${{ toJson(matrix) }}

steps:
- uses: actions/checkout@v3
- name: buildtools on ubuntu
if: startsWith(matrix.config.name, 'ubuntu')
if: ${{ startsWith(matrix.config.os, 'ubuntu') }}
shell: bash
run: |
if [ -n "$PACKAGES" ]; then
sudo apt-get install -y $PACKAGES
PACKAGES_UBUNTU=$(echo $PACKAGES_UBUNTU | sed 's/^[ ]*//;s/[ ]*$//')
if [ -n "$PACKAGES_UBUNTU" ]; then
sudo apt-get update && sudo apt-get install -y $PACKAGES_UBUNTU
fi
- name: buildtools on macos
if: startsWith(matrix.config.name, 'macos') && matrix.config.*.system_packages
if: ${{ startsWith(matrix.config.os, 'macos') }}
shell: bash
run: |
if [ -n "$PACKAGES" ]; then
brew install $PACKAGES
PACKAGES_MACOS=$(echo $PACKAGES_MACOS | sed 's/^[ ]*//;s/[ ]*$//')
if [ -n "$PACKAGES_MACOS" ]; then
brew install $PACKAGES_MACOS
fi
- name: build
shell: bash
run: |
cmake -DBOOST_URL=${{matrix.config.boost_url}} -DZMQ_TAG=${{matrix.config.zmq_tag}} -S .github/workflows/cmake-superbuild -B build
cmake -DBOOST_URL=${{matrix.boost.url}} -DZMQ_TAG=${{matrix.zmq.tag}} ${{matrix.boost.extra_cmake_args}} -S .github/workflows/cmake-superbuild -B build
cmake --build build
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
*.a
*.pyc
build/*
build_*/*

# Other files
.devcontainer
.vscode
.DS_Store
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ Thomas W Rodgers <rodgert@twrodgers.com>
Andrey Upadyshev <oliora@gmail.com>
Tim Blechmann <tim@klingt.org>
Adam Boseley <adam.boseley@gmail.com>
Juan Pablo Pino <jp.pinob@gmail.com>
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16.3...3.25)
# -- v3.16.3 is the default version in the current ubuntu lts release
cmake_minimum_required(VERSION 3.22.1...3.29.2)
# -- v3.22.1 is the default version in the current ubuntu lts release

project(azmq VERSION 1.1.0 LANGUAGES CXX)

Expand All @@ -21,13 +21,18 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# --- dependencies --
find_package(
Boost 1.68
COMPONENTS system
date_time
COMPONENTS date_time
thread
chrono
random
REQUIRED)

# Try to find Boost::system
find_package(Boost COMPONENTS system)
if (NOT Boost_SYSTEM_FOUND)
message(WARNING "Boost::system not found, some examples may not compile")
endif()

include(FindAzmqLibzmq.cmake)

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
Expand All @@ -37,7 +42,7 @@ find_package(Threads REQUIRED)
add_library(${PROJECT_NAME} INTERFACE)
add_library(Azmq::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

target_link_libraries(${PROJECT_NAME} INTERFACE Azmq::libzmq Boost::boost ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${PROJECT_NAME} INTERFACE Azmq::libzmq Boost::boost ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:include>")

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ which supports C++11. Currently this has been tested with -
* Microsoft Visual Studio 2013 on Windows Server 2008 R2

Library dependencies are -
* Boost 1.48 or later
* Boost 1.68 or later
* ZeroMQ 4.0.x

Tests and example code require -
Expand Down
3 changes: 1 addition & 2 deletions azmq/actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "socket.hpp"
#include "detail/actor_service.hpp"

#include <boost/asio/io_service.hpp>
#include "io_service.hpp"

#include <functional>

Expand Down Expand Up @@ -78,4 +78,3 @@ AZMQ_V1_INLINE_NAMESPACE_END
} // namespace actor
} // namespace azmq
#endif // AZMQ_ACTOR_HPP_

3 changes: 1 addition & 2 deletions azmq/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include "detail/socket_service.hpp"
#include "option.hpp"
#include "error.hpp"

#include <boost/asio/io_service.hpp>
#include "io_service.hpp"
#include <zmq.h>

namespace azmq {
Expand Down
3 changes: 1 addition & 2 deletions azmq/detail/actor_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace detail {
: azmq::detail::service_base<actor_service>(ios)
{ }

void shutdown_service() override { }
void shutdown() override { }

using is_alive = opt::boolean<static_cast<int>(opt::limits::lib_actor_min)>;
using detached = opt::boolean<static_cast<int>(opt::limits::lib_actor_min) + 1>;
Expand Down Expand Up @@ -286,4 +286,3 @@ namespace detail {
} // namespace detail
} // namespace azmq
#endif // AZMQ_DETAIL_ACTOR_SERVICE_HPP_

3 changes: 1 addition & 2 deletions azmq/detail/basic_io_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef AZMQ_DETAIL_BASIC_IO_OBJECT_HPP__
#define AZMQ_DETAIL_BASIC_IO_OBJECT_HPP__

#include <boost/asio/io_service.hpp>
#include "../io_service.hpp"
#include <boost/asio/basic_io_object.hpp>

namespace azmq {
Expand Down Expand Up @@ -48,4 +48,3 @@ namespace detail {
} // namespace detail
} // namespace azmq
#endif // AZMQ_DETAIL_BASIC_IO_OBJECT_HPP__

3 changes: 1 addition & 2 deletions azmq/detail/reactor_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#ifndef AZMQ_DETAIL_REACTOR_OP_HPP_
#define AZMQ_DETAIL_REACTOR_OP_HPP_

#include "../io_service.hpp"
#include "../message.hpp"
#include "socket_ops.hpp"

#include <boost/optional.hpp>
#include <boost/asio/io_service.hpp>

namespace azmq {
namespace detail {
Expand Down Expand Up @@ -41,4 +41,3 @@ class reactor_op {
} // namespace detail
} // namespace azmq
#endif // AZMQ_DETAIL_REACTOR_OP_HPP_

4 changes: 1 addition & 3 deletions azmq/detail/receive_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
#define AZMQ_DETAIL_RECEIVE_OP_HPP_

#include "../error.hpp"
#include "../io_service.hpp"
#include "../message.hpp"
#include "socket_ops.hpp"
#include "reactor_op.hpp"

#include <boost/version.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/dispatch.hpp>
#include <boost/asio/executor_work_guard.hpp>
#if BOOST_VERSION >= 107900
Expand Down Expand Up @@ -197,5 +197,3 @@ class receive_op : public receive_op_base {
} // namespace detail
} // namespace azmq
#endif // AZMQ_DETAIL_RECEIVE_OP_HPP_


4 changes: 1 addition & 3 deletions azmq/detail/send_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
#ifndef AZMQ_DETAIL_SEND_OP_HPP_
#define AZMQ_DETAIL_SEND_OP_HPP_
#include "../error.hpp"
#include "../io_service.hpp"
#include "../message.hpp"
#include "socket_ops.hpp"
#include "reactor_op.hpp"

#include <boost/version.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/dispatch.hpp>
#include <boost/asio/executor_work_guard.hpp>
#if BOOST_VERSION >= 107900
Expand Down Expand Up @@ -143,5 +143,3 @@ class send_op : public send_op_base {
} // namespace detail
} // namespace azmq
#endif // AZMQ_DETAIL_SEND_OP_HPP_


3 changes: 1 addition & 2 deletions azmq/detail/service_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef AZMQ_DETAIL_SERVICE_BASE_HPP_
#define AZMQ_DETAIL_SERVICE_BASE_HPP_

#include <boost/asio/io_service.hpp>
#include "../io_service.hpp"

namespace azmq {
namespace detail {
Expand All @@ -35,4 +35,3 @@ namespace detail {
} // namespace detail
} // namespace azmq
#endif // AZMQ_DETAIL_SERVICE_BASE_HPP_

Loading
Loading