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…