From 75d5f91784138565e594fedefc709c4bd5b22f26 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 24 Nov 2020 14:12:54 +0800 Subject: [PATCH] cmake: define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT for Boost.Asio users see also https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/std_executors.html#boost_asio.std_executors.polymorphic_i_o_executor we could use `asio::any_io_executor` later on though for better performance. also, define CMP0093, so FindBoost reports Boost_VERSION in x.y.z format. it is simpler to use `VERSION_GREATER_EQUAL` to compare its version with 1.74 instead of its C macro version ("107000"). Signed-off-by: Kefu Chai (cherry picked from commit 3d708219092d0e89a1434c30ffc8a4999f062cc0) Conflicts: CMakeLists.txt src/librbd/CMakeLists.txt: trivial resolutions --- CMakeLists.txt | 3 ++- src/librbd/CMakeLists.txt | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a71e53ad79bc..79bc8c694b7b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,8 @@ foreach(policy CMP0054 CMP0056 CMP0065 - CMP0075) + CMP0075 + CMP0093) if(POLICY ${policy}) cmake_policy(SET ${policy} NEW) endif() diff --git a/src/librbd/CMakeLists.txt b/src/librbd/CMakeLists.txt index 946f3f5e71ff5..ce78d5417b0b8 100644 --- a/src/librbd/CMakeLists.txt +++ b/src/librbd/CMakeLists.txt @@ -1,3 +1,7 @@ +if(Boost_VERSION VERSION_GREATER_EQUAL 1.74) + add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT) +endif() + add_library(rbd_types STATIC journal/Types.cc mirroring_watcher/Types.cc -- 2.47.3