Skip to content

Commit b8b2a1a

Browse files
committed
Fix compatibility with Boost >= 1.87
1 parent 2f66550 commit b8b2a1a

30 files changed

+147
-91
lines changed

.github/workflows/cmake-superbuild/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ if (NOT (BOOST_URL STREQUAL "system"))
8585
list(APPEND LIBS boost)
8686
endif ()
8787

88-
if (POLICY CMP0167)
89-
cmake_policy(SET CMP0167 NEW)
88+
cmake_policy(GET CMP0167 _cmp0167_value)
89+
if(_cmp0167_value)
90+
set(_policy_arg "-DCMAKE_POLICY_DEFAULT_CMP0167=${_cmp0167_value}")
91+
message(STATUS " Setting superbuild CMP0167 to ${_cmp0167_value} ")
9092
endif()
9193

9294
ExternalProject_Add(
9395
azmq
9496
DEPENDS ${LIBS}
95-
CMAKE_ARGS ${CMAKE_ARGS} -D AZMQ_BUILD_TESTS=YES
97+
CMAKE_ARGS ${CMAKE_ARGS} -D AZMQ_BUILD_TESTS=YES ${_policy_arg}
9698
SOURCE_DIR ${CMAKE_SOURCE_DIR}/../../..
9799
TEST_BEFORE_INSTALL YES)

.github/workflows/cmake.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,35 @@ jobs:
3939
- url: system
4040
system_packages_ubuntu: libboost-all-dev
4141
system_packages_macos: boost
42+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
4243
- url: BOOST_189
4344
system_packages_ubuntu:
4445
system_packages_macos:
46+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
4547
- url: BOOST_187
4648
system_packages_ubuntu:
4749
system_packages_macos:
50+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
4851
- url: BOOST_184
4952
system_packages_ubuntu:
5053
system_packages_macos:
54+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
5155
- url: BOOST_176
5256
system_packages_ubuntu:
5357
system_packages_macos:
58+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
5459
- url: BOOST_174
5560
system_packages_ubuntu:
5661
system_packages_macos:
62+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
5763
- url: BOOST_170
5864
system_packages_ubuntu:
5965
system_packages_macos:
66+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=NEW
6067
- url: BOOST_168
6168
system_packages_ubuntu:
6269
system_packages_macos:
70+
extra_cmake_args: -DCMAKE_POLICY_DEFAULT_CMP0167=OLD
6371
zmq:
6472
- tag: system
6573
system_packages_ubuntu: libzmq3-dev

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
*.a
1414
*.pyc
1515
build/*
16+
build_*/*
17+
18+
# Other files
19+
.devcontainer
20+
.vscode
21+
.DS_Store

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Thomas W Rodgers <rodgert@twrodgers.com>
66
Andrey Upadyshev <oliora@gmail.com>
77
Tim Blechmann <tim@klingt.org>
88
Adam Boseley <adam.boseley@gmail.com>
9+
Juan Pablo Pino <jp.pinob@gmail.com>

CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
cmake_minimum_required(VERSION 3.16.3...3.25)
2-
# -- v3.16.3 is the default version in the current ubuntu lts release
1+
cmake_minimum_required(VERSION 3.22.1...3.29.2)
2+
# -- v3.22.1 is the default version in the current ubuntu lts release
33

44
project(azmq VERSION 1.1.0 LANGUAGES CXX)
55

@@ -21,13 +21,18 @@ set(CMAKE_CXX_EXTENSIONS OFF)
2121
# --- dependencies --
2222
find_package(
2323
Boost 1.68
24-
COMPONENTS system
25-
date_time
24+
COMPONENTS date_time
2625
thread
2726
chrono
2827
random
2928
REQUIRED)
3029

30+
# Try to find Boost::system
31+
find_package(Boost COMPONENTS system)
32+
if (NOT Boost_SYSTEM_FOUND)
33+
message(WARNING "Boost::system not found, some examples may not compile")
34+
endif()
35+
3136
include(FindAzmqLibzmq.cmake)
3237

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

40-
target_link_libraries(${PROJECT_NAME} INTERFACE Azmq::libzmq Boost::boost ${CMAKE_THREAD_LIBS_INIT})
45+
target_link_libraries(${PROJECT_NAME} INTERFACE Azmq::libzmq Boost::boost ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
4146
target_include_directories(${PROJECT_NAME} INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
4247
"$<INSTALL_INTERFACE:include>")
4348

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ which supports C++11. Currently this has been tested with -
2929
* Microsoft Visual Studio 2013 on Windows Server 2008 R2
3030

3131
Library dependencies are -
32-
* Boost 1.48 or later
32+
* Boost 1.68 or later
3333
* ZeroMQ 4.0.x
3434

3535
Tests and example code require -

azmq/actor.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "socket.hpp"
1313
#include "detail/actor_service.hpp"
1414

15-
#include <boost/asio/io_service.hpp>
15+
#include "io_service.hpp"
1616

1717
#include <functional>
1818

@@ -78,4 +78,3 @@ AZMQ_V1_INLINE_NAMESPACE_END
7878
} // namespace actor
7979
} // namespace azmq
8080
#endif // AZMQ_ACTOR_HPP_
81-

azmq/context.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include "detail/socket_service.hpp"
1313
#include "option.hpp"
1414
#include "error.hpp"
15-
16-
#include <boost/asio/io_service.hpp>
15+
#include "io_service.hpp"
1716
#include <zmq.h>
1817

1918
namespace azmq {

azmq/detail/actor_service.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace detail {
5050
: azmq::detail::service_base<actor_service>(ios)
5151
{ }
5252

53-
void shutdown_service() override { }
53+
void shutdown() override { }
5454

5555
using is_alive = opt::boolean<static_cast<int>(opt::limits::lib_actor_min)>;
5656
using detached = opt::boolean<static_cast<int>(opt::limits::lib_actor_min) + 1>;
@@ -286,4 +286,3 @@ namespace detail {
286286
} // namespace detail
287287
} // namespace azmq
288288
#endif // AZMQ_DETAIL_ACTOR_SERVICE_HPP_
289-

azmq/detail/basic_io_object.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef AZMQ_DETAIL_BASIC_IO_OBJECT_HPP__
1010
#define AZMQ_DETAIL_BASIC_IO_OBJECT_HPP__
1111

12-
#include <boost/asio/io_service.hpp>
12+
#include "../io_service.hpp"
1313
#include <boost/asio/basic_io_object.hpp>
1414

1515
namespace azmq {
@@ -48,4 +48,3 @@ namespace detail {
4848
} // namespace detail
4949
} // namespace azmq
5050
#endif // AZMQ_DETAIL_BASIC_IO_OBJECT_HPP__
51-

0 commit comments

Comments
 (0)