【问题标题】:Compiling C++ gRPC for Android为 Android 编译 C++ gRPC
【发布时间】:2018-06-08 10:14:42
【问题描述】:

如何为 Android 编译 C++ gRPC 代码?我已经看过几个关于如何使用 Android Native Development Kit 编译 Protobuf 本身的教程,例如来自Swapnil: How to integrate/install latest c++ protobuf (3.2) with Android NDK?的答案

Google protobuf and Android NDK

但是如何为 Android 编译使用 Protobuf 的 C++ gRPC 代码呢?考虑到gRPC Makefile 有 20K 行。

【问题讨论】:

  • gRPC 有一个 CMakeLists.txt。扫了一眼,我看不出有什么东西可以阻止它被用来生成 NDK 目标,
  • 你最终成功了吗?
  • @David 我的问题怎么可能是重复的,如果它是在一年多前被问到的,而这个问题就在几天前?另外我的问题不仅是关于编译 gRPC,还有 protobuf。
  • @Taier 好的,我将另一个问题标记为您的重复问题。另一个问题有解决 grpc 和 protobuf 编译的答案,因为 grpc 依赖于 protobuf 包:构建 grpc 导致构建 protobuf

标签: c++ makefile android-ndk protocol-buffers grpc


【解决方案1】:

我已经做到了here

简而言之:git submodule gRPC C++,将“CMakeLists.txt”文件添加到您的项目中,了解如何构建 C++ gRPC(以及使用它的代码),将externalNativeBuild/cmake 添加到您的“build.gradle”中 -瞧!

【讨论】:

    猜你喜欢
    • 2019-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多