diff --git a/recipes/asio-grpc/all/conandata.yml b/recipes/asio-grpc/all/conandata.yml index fceefbebebc47..0ac0801843276 100644 --- a/recipes/asio-grpc/all/conandata.yml +++ b/recipes/asio-grpc/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "3.0.0": + url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v3.0.0.tar.gz" + sha256: "299b937cba0b515e7505840ffb891ce8745879365cd918635401f19bf4886591" "2.9.2": url: "https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.9.2.tar.gz" sha256: "a025587278b3332f4c5dd0464b3d5313fbecb89fc58a6ec1d611f693d6b51ef2" diff --git a/recipes/asio-grpc/all/conanfile.py b/recipes/asio-grpc/all/conanfile.py index c686e567d9288..b09691394e263 100644 --- a/recipes/asio-grpc/all/conanfile.py +++ b/recipes/asio-grpc/all/conanfile.py @@ -52,21 +52,22 @@ def configure(self): (self.settings.compiler == "gcc" and compiler_version < "9") or \ (self.settings.compiler == "clang" and compiler_version < "12" and libcxx and str(libcxx) == "libstdc++") self._local_allocator_option = "boost_container" if prefer_boost_container else "memory_resource" - if self._local_allocator_option == "recycling_allocator" and self.options.backend == "unifex": + if self._local_allocator_option == "recycling_allocator" and self.options.backend == "unifex" and Version(self.version) < "3.0.0": raise ConanInvalidConfiguration(f"{self.name} 'recycling_allocator' cannot be used in combination with the 'unifex' backend.") def requirements(self): - self.requires("grpc/1.54.3", transitive_libs=True) - if self._local_allocator_option == "boost_container" or self.options.backend == "boost": + self.requires("grpc/1.54.3", transitive_headers=True, transitive_libs=True) + if (self._local_allocator_option == "boost_container" and Version(self.version) < "3.0.0") or self.options.backend == "boost": self.requires("boost/1.83.0", transitive_headers=True) if self.options.backend == "asio": self.requires("asio/1.29.0", transitive_headers=True) if self.options.backend == "unifex": - self.requires("libunifex/0.4.0") + self.requires("libunifex/0.4.0", transitive_headers=True, transitive_libs=True) def package_id(self): self.info.clear() - self.info.options.local_allocator = self._local_allocator_option + if Version(self.version) < "3.0.0": + self.info.options.local_allocator = self._local_allocator_option def layout(self): cmake_layout(self, src_folder="src") @@ -95,8 +96,9 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["ASIO_GRPC_USE_BOOST_CONTAINER"] = self._local_allocator_option == "boost_container" - tc.variables["ASIO_GRPC_USE_RECYCLING_ALLOCATOR"] = self._local_allocator_option == "recycling_allocator" + if Version(self.version) < "3.0.0": + tc.variables["ASIO_GRPC_USE_BOOST_CONTAINER"] = self._local_allocator_option == "boost_container" + tc.variables["ASIO_GRPC_USE_RECYCLING_ALLOCATOR"] = self._local_allocator_option == "recycling_allocator" tc.generate() def build(self): @@ -115,7 +117,7 @@ def package_info(self): build_modules = [os.path.join("lib", "cmake", "asio-grpc", "AsioGrpcProtobufGenerator.cmake")] - self.cpp_info.requires = ["grpc::grpc++_unsecure"] + self.cpp_info.requires = ["grpc::grpc++"] if self.options.backend == "boost": self.cpp_info.defines = ["AGRPC_BOOST_ASIO"] self.cpp_info.requires.append("boost::headers") @@ -126,7 +128,7 @@ def package_info(self): self.cpp_info.defines = ["AGRPC_UNIFEX"] self.cpp_info.requires.append("libunifex::unifex") - if self._local_allocator_option == "boost_container": + if self._local_allocator_option == "boost_container" and Version(self.version) < "3.0.0": self.cpp_info.requires.append("boost::container") self.cpp_info.set_property("cmake_file_name", "asio-grpc") diff --git a/recipes/asio-grpc/all/test_package/CMakeLists.txt b/recipes/asio-grpc/all/test_package/CMakeLists.txt index 3566d527f1ca9..c63f764daa261 100644 --- a/recipes/asio-grpc/all/test_package/CMakeLists.txt +++ b/recipes/asio-grpc/all/test_package/CMakeLists.txt @@ -7,10 +7,6 @@ add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc) target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) -# See https://github.com/chriskohlhoff/asio/issues/955 -target_compile_definitions(${PROJECT_NAME} - PRIVATE BOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC) - if(${asio-grpc_VERSION} VERSION_GREATER_EQUAL 2) target_compile_definitions(${PROJECT_NAME} PRIVATE ASIO_GRPC_V2) endif() diff --git a/recipes/asio-grpc/all/test_package/test_package.cpp b/recipes/asio-grpc/all/test_package/test_package.cpp index b784be03686dc..6b7094c7b7c60 100644 --- a/recipes/asio-grpc/all/test_package/test_package.cpp +++ b/recipes/asio-grpc/all/test_package/test_package.cpp @@ -16,21 +16,10 @@ int main() { boost::asio::post(grpc_context, [] {}); #ifndef CROSSCOMPILING - std::unique_ptr stub; - grpc::ClientContext client_context; - std::unique_ptr> reader; - test::TestRequest request; - test::TestReply response; - grpc::Status status; - - boost::asio::post(grpc_context, [&]() { - stub = test::Test::NewStub(grpc::CreateChannel( + boost::asio::post(grpc_context, []() { + [[maybe_unused]] auto stub = test::Test::NewStub(grpc::CreateChannel( "localhost:50051", grpc::InsecureChannelCredentials())); - request.set_message("hello"); - reader = agrpc::request(&test::Test::Stub::AsyncUnary, *stub, - client_context, request, grpc_context); - agrpc::finish(reader, response, status, - boost::asio::bind_executor(grpc_context, [](bool) {})); + [[maybe_unused]] test::TestRequest request; }); #endif } diff --git a/recipes/asio-grpc/config.yml b/recipes/asio-grpc/config.yml index b9f64d2363051..db1e33d31a8f4 100644 --- a/recipes/asio-grpc/config.yml +++ b/recipes/asio-grpc/config.yml @@ -1,4 +1,6 @@ versions: + "3.0.0": + folder: all "2.9.2": folder: all "2.7.0":