pw_tokenizer: pw_tokenizer_database fix for no-targets case

Change-Id: I0bf505bd769c7ba34f38ffbb831ca4da12d155f3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/22960
Reviewed-by: David Rogers <davidrogers@google.com>
Commit-Queue: David Rogers <davidrogers@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
diff --git a/pw_tokenizer/database.gni b/pw_tokenizer/database.gni
index a6cbf7e..a1261d0 100644
--- a/pw_tokenizer/database.gni
+++ b/pw_tokenizer/database.gni
@@ -82,6 +82,11 @@
     _domain = ""
   }
 
+  if (_targets == [] && _optional_targets == []) {
+    # If no targets were specified, the domain will not be used, which is OK.
+    not_needed([ "_domain" ])
+  }
+
   pw_python_action(target_name) {
     script = "$dir_pw_tokenizer/py/pw_tokenizer/database.py"