Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BOOST_ASIO_NO_TS_EXECUTORS #830

Merged
merged 7 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ OPTION(MQTT_STD_STRING_VIEW "Use std::string_view from C++17 instead of boost::s
OPTION(MQTT_STD_ANY "Use std::any from C++17 instead of boost::any" OFF)
OPTION(MQTT_STD_SHARED_PTR_ARRAY "Use std::shared_ptr<char[]> from C++17 instead of boost::shared_ptr<char[]>" OFF)
OPTION(MQTT_DISABLE_LIBSTDCXX_TUPLE_ANY_WORKAROUND "std::tuple<std::any> workaround for libstdc++" OFF)
OPTION(MQTT_NO_TS_EXECUTORS "Use standard executors instead of Networking TS-style executors" OFF)

IF (POLICY CMP0074)
CMAKE_POLICY(SET CMP0074 NEW)
Expand Down Expand Up @@ -87,6 +88,12 @@ ELSE ()
MESSAGE (STATUS "std::tuple<std::any> workaround for libstdc++ enabled")
ENDIF ()

IF (MQTT_NO_TS_EXECUTORS)
MESSAGE (STATUS "Using standard executors instead of Networking TS-style executors")
ELSE ()
MESSAGE (STATUS "Using Networking TS-style executors instead of standard executors")
ENDIF ()


IF ( MQTT_STD_VARIANT
OR MQTT_STD_OPTIONAL
Expand Down Expand Up @@ -129,6 +136,10 @@ ELSE ()
FIND_PACKAGE (Boost 1.67.0 REQUIRED COMPONENTS system date_time program_options)
ENDIF ()

IF (MQTT_NO_TS_EXECUTORS AND ((Boost_MAJOR_VERSION LESS 1) OR (Boost_MINOR_VERSION LESS 74)))
MESSAGE(FATAL_ERROR "Boost version 1.74.0 or later is required for use with standard executors")
ENDIF ()

IF (MQTT_USE_TLS)
FIND_PACKAGE (OpenSSL REQUIRED)
IF (MQTT_USE_STATIC_OPENSSL)
Expand Down
1 change: 1 addition & 0 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$<BOOL:${MQTT_STD_ANY}>:M
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$<BOOL:${MQTT_STD_STRING_VIEW}>:MQTT_STD_STRING_VIEW>)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$<BOOL:${MQTT_STD_SHARED_PTR_ARRAY}>:MQTT_STD_SHARED_PTR_ARRAY>)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$<BOOL:${MQTT_DISABLE_LIBSTDCXX_TUPLE_ANY_WORKAROUND}>:MQTT_DISABLE_LIBSTDCXX_TUPLE_ANY_WORKAROUND>)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} INTERFACE $<$<BOOL:${MQTT_NO_TS_EXECUTORS}>:MQTT_NO_TS_EXECUTORS>)

# You might wonder why we don't simply add the list of header files to the check_deps
# executable directly, and let cmake figure everything out on it's own.
Expand Down
Loading