-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmcpp.toml
More file actions
52 lines (51 loc) · 2.33 KB
/
Copy pathmcpp.toml
File metadata and controls
52 lines (51 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# grpcgen — the gRPC/protobuf codegen rule, as a package.
#
# A rule ("run protoc and grpc_cpp_plugin over these .proto files") should be
# written once, not copy-pasted into every consumer's build.mcpp. mcpp ships it
# as an ordinary library package that the consumer imports from its build
# program:
#
# [dependencies]
# grpcgen = { version = "1.83.0", host-module = true }
#
# // build.mcpp
# import mcpp;
# import grpcgen;
# int main() { return grpcgen::generate({"helloworld"}) ? 0 : 1; }
#
# Rules are therefore versioned, testable and distributed through the package
# manager that already exists — and written in C++, so the build does not grow
# a second language the way xmake's Lua rules or Bazel's Starlark do.
#
# The package name and the module name are kept EQUAL, and that is what makes
# this package work on every engine rather than on the newest one.
#
# mcpp < 2026.8.29.1 registers a host module under the dependency's
# `package.name`, so on those engines the name here IS the module name. From
# 2026.8.29.1 the module name is what `src/grpcgen.cppm` declares, and the
# package name carries no C++ naming constraint at all.
#
# Keeping the two equal satisfies both. Renaming either one alone would build
# under GCC and fail under Clang and MSVC on the older engines -- GCC finds the
# BMI by the declared name through gcm.cache, while the other two are handed an
# explicit `<name>=<bmi>` mapping built from the registered name.
#
# Versioned in lock-step with grpc and grpc-plugin: all three ship from one
# tag, and .github/workflows/ci.yml checks that they never drift apart.
[package]
name = "grpcgen"
version = "1.83.0"
standard = "c++23"
description = "protoc + grpc_cpp_plugin codegen as an importable mcpp build rule"
license = "Apache-2.0"
repo = "https://github.com/mcpplibs/grpc-m"
platforms = ["linux", "macos", "windows"]
# No dependencies, and from 2026.8.29.1 that is a CHOICE rather than a limit.
# Before it, a host module was compiled alone and could import only `std` and
# the bundled `mcpp` module; since it, a rule may declare its own
# `[build-dependencies]` and import any of them marked `host-module = true`.
#
# This rule stays a leaf so that it keeps working on older engines, and because
# it has nothing to reuse: what it does is compute a protoc command line.
[targets.grpcgen]
kind = "lib"