pw_protobuf_compiler: Ensure SOURCES is provided in CMake

Change-Id: I06b1964882830a4a7c7e94171a61a75cc0771df7
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/37420
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
diff --git a/pw_protobuf_compiler/proto.cmake b/pw_protobuf_compiler/proto.cmake
index cc07ce0..60b146b 100644
--- a/pw_protobuf_compiler/proto.cmake
+++ b/pw_protobuf_compiler/proto.cmake
@@ -39,6 +39,12 @@
   cmake_parse_arguments(PARSE_ARGV 1 arg "" "STRIP_PREFIX;PREFIX"
       "SOURCES;INPUTS;DEPS")
 
+  if("${arg_SOURCES}" STREQUAL "")
+    message(FATAL_ERROR
+        "pw_proto_library requires at least one .proto file in SOURCES. No "
+        "SOURCES were listed for ${NAME}.")
+  endif()
+
   set(out_dir "${CMAKE_CURRENT_BINARY_DIR}/${NAME}")
 
   # Use INTERFACE libraries to track the proto include paths that are passed to