pw_protobuf_compiler: Add pw_build to cmake deps

We need an interface dependency on pw_build to inherit its build
options. This is breaking linking in some Matter builds that pass the
arch flags by injecting dependencies into pw_build.

No-Docs-Update-Reason: bug fix

Change-Id: If1c2062502839e0470981b60bad1010321e03ff5
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66760
Reviewed-by: Rob Oliver <rgoliver@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Michael Spang <spang@google.com>
diff --git a/pw_protobuf_compiler/proto.cmake b/pw_protobuf_compiler/proto.cmake
index 62f6eaf..5ea10ea 100644
--- a/pw_protobuf_compiler/proto.cmake
+++ b/pw_protobuf_compiler/proto.cmake
@@ -187,7 +187,7 @@
   # Create the library with the generated source files.
   add_library("${NAME}.pwpb" INTERFACE)
   target_include_directories("${NAME}.pwpb" INTERFACE "${OUT_DIR}/pwpb")
-  target_link_libraries("${NAME}.pwpb" INTERFACE pw_protobuf ${DEPS})
+  target_link_libraries("${NAME}.pwpb" INTERFACE pw_build pw_protobuf ${DEPS})
   add_dependencies("${NAME}.pwpb" "${NAME}._generate.pwpb")
 endfunction(_pw_pwpb_library)
 
@@ -211,6 +211,7 @@
   target_include_directories("${NAME}.raw_rpc" INTERFACE "${OUT_DIR}/raw_rpc")
   target_link_libraries("${NAME}.raw_rpc"
     INTERFACE
+      pw_build
       pw_rpc.raw
       pw_rpc.server
       ${DEPS}
@@ -244,6 +245,7 @@
       add_library("${NAME}.nanopb" INTERFACE)
       target_link_libraries("${NAME}.nanopb"
         INTERFACE
+          pw_build
           pw_third_party.nanopb
           ${DEPS}
       )
@@ -262,7 +264,7 @@
       # Create the library with the generated source files.
       add_library("${NAME}.nanopb" EXCLUDE_FROM_ALL ${generated_outputs})
       target_include_directories("${NAME}.nanopb" PUBLIC "${OUT_DIR}/nanopb")
-      target_link_libraries("${NAME}.nanopb" PUBLIC pw_third_party.nanopb ${DEPS})
+      target_link_libraries("${NAME}.nanopb" PUBLIC pw_build pw_third_party.nanopb ${DEPS})
     endif()
 
     add_dependencies("${NAME}.nanopb" "${NAME}._generate.nanopb")
@@ -299,6 +301,7 @@
   target_link_libraries("${NAME}.nanopb_rpc"
     INTERFACE
       "${NAME}.nanopb"
+      pw_build
       pw_rpc.nanopb.client
       pw_rpc.nanopb.method_union
       pw_rpc.server