Skip to content

Commit

Permalink
cmake: define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT for Boost.Asio users
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tchaikov committed Nov 24, 2020
1 parent cf18f7e commit 3d70821
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ foreach(policy
CMP0056
CMP0065
CMP0074
CMP0075)
CMP0075
CMP0093)
if(POLICY ${policy})
cmake_policy(SET ${policy} NEW)
endif()
Expand Down
4 changes: 4 additions & 0 deletions src/librbd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if(Boost_VERSION VERSION_GREATER_EQUAL 1.74)
add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
endif()

set(librbd_types_srcs
journal/Types.cc
mirroring_watcher/Types.cc
Expand Down

0 comments on commit 3d70821

Please sign in to comment.