Commit Graph

9 Commits

Author SHA1 Message Date
Alexei Frolov
b499d3f28c pw_protobuf_compiler: Remove pw_protobuf_GENERATORS build arg
This updates pw_protobuf_compiler to always create a target for each
supported protobuf generator, instead of having a build arg to select
which ones to use, simplifying the use of pw_proto_library.

Change-Id: I2699c9c5045e8671a061f8c8bc11a94244d008f1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22721
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2020-10-29 01:08:02 +00:00
Alexei Frolov
8e30d46622 pw_protobuf_compiler: Rename generated GN targets
This updates generated protobuf targets to use the format
<target>.<generator> instead of <target>_<generator> to improve
readability.

Change-Id: I52d1e398d5bbece7f79ae87e9a1df7fdce880a6b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22222
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
2020-10-23 19:30:06 +00:00
Wyatt Hepler
d49f8fe3f3 BUILD.gn files: Improve import formatting
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.

Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
2020-10-15 18:12:55 +00:00
Alexei Frolov
4c0428a0d8 Define Linux clang target as toolchain
This change configures the Linux clang -Og target as a toolchain with
args. To support this, all Pigweed variables from pw_vars_default are
made into build args, defined within their respective modules.

The Linux clang target/toolchain is the only one that currently works.
Pigweed's other targets will be ported in later changes.

Change-Id: I051e29fde7577e41a3184c37031a4e04936404e1
2020-06-16 09:50:59 -07:00
Armando Montanez
fb3d3fba79 Don't declare pigweed variables as globals
Require targets to explicitly import pigweed variable definitions. This
moves out some necessary logic from the BUILDCONFIG.gn file.

Change-Id: If9c9fe5a680cc9d897a0e8a55889873be618ed84
2020-06-16 09:50:59 -07:00
Alexei Frolov
f39cd8b5ba pw_protobuf_compiler: nanopb support
This change adds support for compiling nanopb protobufs using
pw_protobuf_compiler.

The pw_protobuf_langs build variable is renamed to
pw_protobuf_generators as there is no longer a 1:1 mapping of languages.

To compile nanopb, add the "nanopb" generator to pw_protobuf_generators.
The build variable $dir_third_party_nanopb must be set to point to a
local installation of nanopb with GN support:

  https://github.com/frolv/nanopb/tree/gn-build

The host build will run a test which compiles nanopb code if
$dir_third_party_nanopb is set.

Change-Id: I29bf8780644917f35203a538b0bd7e4f3ec40180
2020-04-15 18:19:44 +00:00
Rob Mohr
a0ba54f648 Roll GN to 239533d
This caused gn format to flag many things which were also fixed.

Change-Id: Ie1d9081a1b08047bec52c60f54d2a94366be1ba6
2020-02-28 01:33:18 +00:00
Rob Mohr
21117d8c25 Run 'pw format --fix' on a few files.
Change-Id: I2300a824443ba9bca56ab1116fb451cb3003ea02
2019-12-16 19:06:00 +00:00
Alexei Frolov
942adf02d6 Add pw_protobuf_compiler module
This change adds a module responsible for invoking the protobuf compiler
to generate code from .proto definition files. It provides a GN template
which performs the codegen operation on a list of input .proto files.
The template currently only supports C++.

Change-Id: I5558fd5b4282e0d6f09f8fafebda972738dc1e83
2019-12-13 19:38:27 +00:00