2020-10-01 01:59:33 +00:00
|
|
|
.. _target-host:
|
2020-03-19 19:13:36 +00:00
|
|
|
|
|
|
|
----
|
|
|
|
host
|
|
|
|
----
|
2020-07-17 23:34:00 +00:00
|
|
|
The Pigweed host target is used for unit testing and some host side tooling.
|
2020-03-19 19:13:36 +00:00
|
|
|
|
|
|
|
Building
|
|
|
|
========
|
2020-07-13 21:35:16 +00:00
|
|
|
To build for this target, invoke ninja with the top-level "host" group as the
|
|
|
|
target to build.
|
2020-03-19 19:13:36 +00:00
|
|
|
|
|
|
|
.. code:: sh
|
|
|
|
|
2020-06-15 23:30:40 +00:00
|
|
|
$ ninja -C out host
|
2020-03-19 19:13:36 +00:00
|
|
|
|
2020-06-15 23:30:40 +00:00
|
|
|
There are two host toolchains, and both of them can be manually invoked by
|
|
|
|
replacing `host` with `host_clang` or `host_gcc`. Not all toolchains are
|
|
|
|
supported on all platforms. Unless working specifically on one toolchain, it is
|
|
|
|
recommended to leave this to the default.
|
2020-03-19 19:13:36 +00:00
|
|
|
|
|
|
|
Running Tests
|
|
|
|
=============
|
|
|
|
Tests are automatically run as part of the host build, but if you desire to
|
|
|
|
manually run tests, you may invoke them from a shell directly.
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
... code:: sh
|
|
|
|
|
2020-07-17 23:34:00 +00:00
|
|
|
$ ./out/host_[compiler]_debug/obj/pw_status/status_test
|
2020-03-19 19:13:36 +00:00
|
|
|
|
2020-12-30 00:15:40 +00:00
|
|
|
RPC server
|
|
|
|
==========
|
|
|
|
The host target implements a system RPC server that runs over a local socket,
|
|
|
|
defaulting to port 33000. To communicate with a process running the host RPC
|
|
|
|
server, use ``pw rpc -s localhost:33000 <protos>``.
|
|
|
|
|
2020-03-19 19:13:36 +00:00
|
|
|
Configuration
|
|
|
|
=============
|
|
|
|
The host target exposes a few options that may be used to change the host build
|
|
|
|
behavior.
|
|
|
|
|
2020-06-15 23:30:40 +00:00
|
|
|
pw_build_HOST_TOOLS
|
2020-03-19 19:13:36 +00:00
|
|
|
-------------------
|
|
|
|
Pigweed includes a number of host-only tooling that may be built as part of the
|
|
|
|
host build. These tools are included as part of the bootstrap, so it's only
|
|
|
|
necessary to enable this setting when modifying host tooling. This is
|
|
|
|
disabled by default.
|