]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT for Boost.Asio users 38760/head
authorKefu Chai <kchai@redhat.com>
Tue, 24 Nov 2020 06:12:54 +0000 (14:12 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 8 Jan 2021 08:39:59 +0000 (16:39 +0800)
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 <kchai@redhat.com>
(cherry picked from commit 3d708219092d0e89a1434c30ffc8a4999f062cc0)

Conflicts:
CMakeLists.txt
src/librbd/CMakeLists.txt: change ""Boost_VERSION
VERSION_GREATER_EQUAL "1.74" to "Boost_VERSION VERSION_GREATER
1.73" as "VERSION_GREATER_EQUAL" was introduced in a newer version of
CMake, which is not available in ubuntu/xenial.
src/rgw/CMakeLists.txt: add the same macro definition applied to
          librbd. without which, src/rgw/rgw_sync_module_aws.cc
          still fails to compile with boost 1.74

CMakeLists.txt
src/librbd/CMakeLists.txt
src/rgw/CMakeLists.txt

index 5b7a67bec60285e45d5a52ecbb677e9ec91b28fe..8a5b1c44ba166ffd1907211951c59259659590ef 100644 (file)
@@ -24,6 +24,9 @@ endif()
 if(POLICY CMP0075)
   cmake_policy(SET CMP0075 NEW)
 endif()
+if(POLICY CMP0093)
+  cmake_policy(SET CMP0093 NEW)
+endif()
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
 
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
index 30626d02bdf667c7854ac067e6c606f298ed1d82..149c19df697a28bf1b7295053b9a9ceb82815774 100644 (file)
@@ -1,3 +1,7 @@
+if(Boost_VERSION VERSION_GREATER 1.73)
+  add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+endif()
+
 add_library(rbd_types STATIC
   journal/Types.cc
   mirroring_watcher/Types.cc
index 9bfde0e457c206121a7f571eca2f5e9418fbb35e..116dd435f650689371298654a46335f2a0a20522 100644 (file)
@@ -19,6 +19,10 @@ function(gperf_generate input output)
     )
 endfunction()
 
+if(Boost_VERSION VERSION_GREATER 1.73)
+  add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+endif()
+
 set(librgw_common_srcs
   services/svc_finisher.cc
   services/svc_notify.cc