Silence unused argument warnings

moves pw_trace-related build args into imports so toolchains can import
them and silence unused build-arg warnings for downstream projects that
use Pigweed's default host toolchain but don't use pw_trace.

Change-Id: I25cd8b59e2b05e0345e9ed738c4b06beff9a5069
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/36080
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_trace/BUILD.gn b/pw_trace/BUILD.gn
index 25111d2..b0e455b 100644
--- a/pw_trace/BUILD.gn
+++ b/pw_trace/BUILD.gn
@@ -17,11 +17,7 @@
 import("$dir_pw_build/facade.gni")
 import("$dir_pw_docgen/docs.gni")
 import("$dir_pw_unit_test/test.gni")
-
-declare_args() {
-  # Backend for the pw_trace module.
-  pw_trace_BACKEND = ""
-}
+import("backend.gni")
 
 config("default_config") {
   include_dirs = [ "public" ]
diff --git a/pw_trace/backend.gni b/pw_trace/backend.gni
new file mode 100644
index 0000000..961dd57
--- /dev/null
+++ b/pw_trace/backend.gni
@@ -0,0 +1,18 @@
+# Copyright 2021 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+declare_args() {
+  # Backend for the pw_trace module.
+  pw_trace_BACKEND = ""
+}
diff --git a/pw_trace_tokenized/BUILD.gn b/pw_trace_tokenized/BUILD.gn
index 86403f8..6ed2a0b 100644
--- a/pw_trace_tokenized/BUILD.gn
+++ b/pw_trace_tokenized/BUILD.gn
@@ -14,25 +14,12 @@
 
 import("//build_overrides/pigweed.gni")
 
-import("$dir_pw_build/module_config.gni")
 import("$dir_pw_build/target_types.gni")
 import("$dir_pw_docgen/docs.gni")
 import("$dir_pw_protobuf_compiler/proto.gni")
 import("$dir_pw_third_party/nanopb/nanopb.gni")
 import("$dir_pw_unit_test/test.gni")
-
-declare_args() {
-  # The build target that overrides the default configuration options for this
-  # module. This should point to a source set that provides defines through a
-  # public config (which may -include a file or add defines directly).
-  pw_trace_CONFIG = pw_build_DEFAULT_MODULE_CONFIG
-
-  # Tokenizer trace time, gets included if provided
-  pw_trace_tokenizer_time = ""
-
-  # Trace buffer size in bytes. Set to 0 to disable.
-  pw_trace_tokenized_BUFFER_SIZE = 256
-}
+import("config.gni")
 
 config("public_include_path") {
   include_dirs = [ "public" ]
diff --git a/pw_trace_tokenized/config.gni b/pw_trace_tokenized/config.gni
new file mode 100644
index 0000000..4aef650
--- /dev/null
+++ b/pw_trace_tokenized/config.gni
@@ -0,0 +1,30 @@
+# Copyright 2021 The Pigweed Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+import("//build_overrides/pigweed.gni")
+
+import("$dir_pw_build/module_config.gni")
+
+declare_args() {
+  # The build target that overrides the default configuration options for this
+  # module. This should point to a source set that provides defines through a
+  # public config (which may -include a file or add defines directly).
+  pw_trace_CONFIG = pw_build_DEFAULT_MODULE_CONFIG
+
+  # Tokenizer trace time, gets included if provided
+  pw_trace_tokenizer_time = ""
+
+  # Trace buffer size in bytes. Set to 0 to disable.
+  pw_trace_tokenized_BUFFER_SIZE = 256
+}
diff --git a/targets/host/target_toolchains.gni b/targets/host/target_toolchains.gni
index aa64fa5..05d593c 100644
--- a/targets/host/target_toolchains.gni
+++ b/targets/host/target_toolchains.gni
@@ -23,6 +23,8 @@
 import("$dir_pw_thread/backend.gni")
 import("$dir_pw_toolchain/host_clang/toolchains.gni")
 import("$dir_pw_toolchain/host_gcc/toolchains.gni")
+import("$dir_pw_trace/backend.gni")
+import("$dir_pw_trace_tokenized/config.gni")
 
 _host_common = {
   # Use logging-based test output on host.