mcpp index

grpc.grpc

import

gRPC 1.83.0 — vendored upstream source build with import grpc; (abseil/protobuf/re2/c-ares/OpenSSL come from this index)

import grpc;

模块名读自上游 src/grpc.cppm 里的 `export module` 声明。

mcpp add grpc.grpc@1.83.0

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// Behavioral test for the mcpplibs.grpc package, driven entirely through
// `import grpc;` — there is no <grpcpp/...> include in this file. Every call
// reaches a real symbol in the linked gRPC, so a package that resolved and
// "built" but linked nothing could not pass.
//
// Note the ORDER: textual #includes first, `import grpc;` last. The module
// carries the standard library in its BMI, so a std header included after the
// import arrives twice and GCC fails on std::string's operator==.
// HAVE_GRPC comes from this project's own cfg-gated cxxflags — the package is
// linux/macOS-only (see mcpp.toml), so elsewhere this file is an empty main().
#ifdef HAVE_GRPC

#include <cstdio>
#include <string>

import grpc;

int main() {
    // A version string read out of the library, not a header constant.
    const std::string version = grpc::Version();
    std::printf("grpc::Version() = %s\n", version.c_str());
    if (version.rfind("1.83", 0) != 0) return 1;
// …

tests/examples/grpc-module/tests/module.cpp · 项目 tests/examples/grpc-module

构建 · 上游清单

modules
grpc
targets
grpc (lib)
language
c++23
manifest version
1.83.0
dependencies
compat
来源
https://raw.githubusercontent.com/mcpplibs/grpc-m/v1.83.0-4/mcpp.toml

版本

版本平台 镜像sha256
1.83.0 最新 LinuxmacOS CN GLOBAL 991e9928e0fd…