@@ -4,6 +4,14 @@ list(APPEND exec_PROGRAMS
4
4
client_cli.cpp
5
5
)
6
6
7
+ if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
8
+ set (CMAKE_CXX_STANDARD 20)
9
+ message (STATUS "C++20 tools added" )
10
+ list (APPEND exec_PROGRAMS
11
+ cpp20coro_broker.cpp
12
+ )
13
+ endif ()
14
+
7
15
find_package (Boost 1.82.0 REQUIRED COMPONENTS program_options)
8
16
9
17
# Without this setting added, azure pipelines completely fails to find the boost libraries. No idea why.
@@ -58,29 +66,53 @@ endforeach()
58
66
59
67
# Separate compiled broker
60
68
if (ASYNC_MQTT_BUILD_LIB)
61
-
62
- add_executable (broker_separate broker.cpp)
63
- add_dependencies (broker_separate async_mqtt_asio_bind async_mqtt_protocol)
64
- target_compile_definitions (broker_separate PRIVATE ASYNC_MQTT_SEPARATE_COMPILATION)
65
- target_include_directories (broker_separate PRIVATE include ${Boost_INCLUDE_DIRS} )
66
- target_link_libraries (broker_separate async_mqtt_iface async_mqtt_asio_bind async_mqtt_protocol)
67
- if (ASYNC_MQTT_USE_LOG)
69
+ add_executable (broker_separate broker.cpp)
70
+ add_dependencies (broker_separate async_mqtt_asio_bind async_mqtt_protocol)
71
+ target_compile_definitions (broker_separate PRIVATE ASYNC_MQTT_SEPARATE_COMPILATION)
72
+ target_include_directories (broker_separate PRIVATE include ${Boost_INCLUDE_DIRS} )
73
+ target_link_libraries (broker_separate async_mqtt_iface async_mqtt_asio_bind async_mqtt_protocol)
74
+ if (ASYNC_MQTT_USE_LOG)
75
+ target_compile_definitions (
76
+ broker_separate
77
+ PUBLIC
78
+ $<IF:$<BOOL :${ASYNC_MQTT_USE_STATIC_BOOST} >,,BOOST_LOG_DYN_LINK>
79
+ )
80
+ target_link_libraries (
81
+ broker_separate Boost::log
82
+ )
83
+ endif ()
68
84
target_compile_definitions (
69
85
broker_separate
70
86
PUBLIC
71
- $<IF:$<BOOL :${ASYNC_MQTT_USE_STATIC_BOOST} >,,BOOST_LOG_DYN_LINK>
72
- )
73
- target_link_libraries (
74
- broker_separate Boost::log
87
+ $<IF:$<BOOL :${ASYNC_MQTT_USE_STATIC_BOOST} >,,BOOST_PROGRAM_OPTIONS_DYN_LINK>
75
88
)
76
- endif ()
77
- target_compile_definitions (
78
- broker_separate
79
- PUBLIC
80
- $<IF:$<BOOL :${ASYNC_MQTT_USE_STATIC_BOOST} >,,BOOST_PROGRAM_OPTIONS_DYN_LINK>
81
- )
82
- target_link_libraries (broker_separate Boost::program_options)
89
+ target_link_libraries (broker_separate Boost::program_options)
83
90
91
+ if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
92
+ set (CMAKE_CXX_STANDARD 20)
93
+ message (STATUS "C++20 separate broker added" )
94
+ add_executable (cpp20coro_broker_separate cpp20coro_broker.cpp)
95
+ add_dependencies (cpp20coro_broker_separate async_mqtt_asio_bind async_mqtt_protocol)
96
+ target_compile_definitions (cpp20coro_broker_separate PRIVATE ASYNC_MQTT_SEPARATE_COMPILATION)
97
+ target_include_directories (cpp20coro_broker_separate PRIVATE include ${Boost_INCLUDE_DIRS} )
98
+ target_link_libraries (cpp20coro_broker_separate async_mqtt_iface async_mqtt_asio_bind async_mqtt_protocol)
99
+ if (ASYNC_MQTT_USE_LOG)
100
+ target_compile_definitions (
101
+ cpp20coro_broker_separate
102
+ PUBLIC
103
+ $<IF:$<BOOL :${ASYNC_MQTT_USE_STATIC_BOOST} >,,BOOST_LOG_DYN_LINK>
104
+ )
105
+ target_link_libraries (
106
+ cpp20coro_broker_separate Boost::log
107
+ )
108
+ endif ()
109
+ target_compile_definitions (
110
+ cpp20coro_broker_separate
111
+ PUBLIC
112
+ $<IF:$<BOOL :${ASYNC_MQTT_USE_STATIC_BOOST} >,,BOOST_PROGRAM_OPTIONS_DYN_LINK>
113
+ )
114
+ target_link_libraries (cpp20coro_broker_separate Boost::program_options)
115
+ endif ()
84
116
endif ()
85
117
86
118
if (UNIX )
0 commit comments