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

ASIO gRPC boost container fix #174

Merged
merged 3 commits into from
May 9, 2024
Merged
Changes from all 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
31 changes: 31 additions & 0 deletions FindAsioGrpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,39 @@

include("GenericFindDependency")

# asio-grpc has some logic to conditionally enable boost containers, this
# should just be defaulted to false since the standard library offers the same
# functionality.
option(ASIO_GRPC_USE_BOOST_CONTAINER "(deprecated) Use Boost.Container instead of <memory_resource>" false)

GenericFindDependency(
TARGET asio-grpc::asio-grpc-standalone-asio
SOURCE_DIR asio-grpc
SYSTEM_INCLUDES
)

# Older libc++ versions like the one that ships with clang < v16 doesn't offer
# the "memory_resource" standard header which is used by the library, instead
# we conditionally select it to use "experimental/memory_resource" which is
# available. The conditional selection is done via a customer preprocessor
# which we've (Swift Navigation) introduced.
include(CheckExperimentalMemoryResource)
check_experimental_memory_resource(IS_EXPERIMENTAL_MEMORY_RESOURCE)
if (IS_EXPERIMENTAL_MEMORY_RESOURCE)
target_compile_definitions(asio-grpc-standalone-asio
INTERFACE
SWIFTNAV_EXPERIMENTAL_MEMORY_RESOURCE
)
endif()

# asio-grpc uses language features that are removed in c++20, the libc++
# implementation actually removed these features unless you set a special
# macro.
include(CheckLibcpp)
check_libcpp(IS_LIBCPP)
if (IS_LIBCPP)
target_compile_definitions(asio-grpc-standalone-asio
INTERFACE
_LIBCPP_ENABLE_CXX20_REMOVED_FEATURES
)
endif()
Loading