pw_protobuf_compiler: Pass plugin paths

- Rather than relying on Python entry point scripts to get paths to
  protoc plugins, pass the paths to the generate_protos.py script. This
  works in environments where the Python entry points are not available.
- Use unique paths for generated proto code in the GN build. This allows
  multiple GN targets to generate code from the same .proto files. The
  CMake build already worked like this.
- Cleanup and reduce code duplication in the CMake and GN proto
  generation code.
- Support Windows builds: generate .bat wrapper script for plugins, fix
  compilation issue that affects some older compilers.

Change-Id: Iab27a3d193d6008567b324dc1c4e5f540894b8ff
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/24380
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Zoltan Szatmary-Ban <szatmz@google.com>
diff --git a/pw_build/docs.rst b/pw_build/docs.rst
index d78818b..d1c5b46 100644
--- a/pw_build/docs.rst
+++ b/pw_build/docs.rst
@@ -422,16 +422,24 @@
 The ``pw_add_facade`` function declares a cache variable named
 ``<module_name>_BACKEND`` for each facade. Cache variables can be awkward to
 work with, since their values only change when they're assigned, but then
-persist accross CMake invocations. It is recommended set these variables as
-follows:
+persist accross CMake invocations. These variables should be set in one of the
+following ways:
 
-* Use ``pw_set_backend`` to set backends appropriate for the target in the
+* Call ``pw_set_backend`` to set backends appropriate for the target in the
   target's toolchain file. The toolchain file is provided to ``cmake`` with
   ``-DCMAKE_TOOLCHAIN_FILE=<toolchain file>``.
-* To temporarily override a backend, set it interactively with ``ccmake`` or
+* Call ``pw_set_backend`` in the top-level ``CMakeLists.txt`` before other
+  CMake code executes.
+* Set the backend variable at the command line with the ``-D`` option.
+
+  .. code-block:: sh
+
+    cmake -B out/cmake_host -S "$PW_ROOT" -G Ninja \
+        -DCMAKE_TOOLCHAIN_FILE=$PW_ROOT/pw_toolchain/host_clang/toolchain.cmake \
+        -Dpw_log_BACKEND=pw_log_basic
+
+* Temporarily override a backend by setting it interactively with ``ccmake`` or
   ``cmake-gui``.
-* To force to a backend to a particular value globally, call ``pw_set_backend``
-  in the top-level ``CMakeLists.txt`` before any other CMake code is executed.
 
 Toolchain setup
 ---------------
@@ -458,16 +466,25 @@
 "")``), the dependency is not available. Otherwise, it is available and
 libraries declared by it can be referenced.
 
-The third_party variable may be set with the CMake ``set`` function in the
-toolchain file or a ``CMakeLists.txt`` prior to adding any directories. This
-statement sets the third-party variable for Nanopb to ``PRESENT``:
+Third party variables are set like any other cache global variable in CMake. It
+is recommended to set these in one of the following ways:
 
-.. code-block:: cmake
+* Set with the CMake ``set`` function in the toolchain file or a
+  ``CMakeLists.txt`` before other CMake code executes.
 
-  set(dir_pw_third_party_nanopb PRESENT CACHE STRING "" FORCE)
+  .. code-block:: cmake
 
-Alternately, the variable may be set temporarily with ``ccmake`` or
-``cmake-gui``.
+    set(dir_pw_third_party_nanopb PRESENT CACHE STRING "" FORCE)
+
+* Set the variable at the command line with the ``-D`` option.
+
+  .. code-block:: sh
+
+    cmake -B out/cmake_host -S "$PW_ROOT" -G Ninja \
+        -DCMAKE_TOOLCHAIN_FILE=$PW_ROOT/pw_toolchain/host_clang/toolchain.cmake \
+        -Ddir_pw_third_party_nanopb=/path/to/nanopb
+
+* Set the variable interactively with ``ccmake`` or ``cmake-gui``.
 
 Use Pigweed from an existing CMake project
 ------------------------------------------