Cleanup to DECLARE_string in header file, and make sure dependency is clearer.
Change-Id: I103575ef6d56a3f50da0c60ca44aacb3f02194e9
diff --git a/aos/configuration.cc b/aos/configuration.cc
index 43e44f2..55e58f1 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -22,11 +22,6 @@
#include "gflags/gflags.h"
#include "glog/logging.h"
-DEFINE_string(
- override_hostname, "",
- "If set, this forces the hostname of this node to be the provided "
- "hostname.");
-
namespace aos {
// Define the compare and equal operators for Channel and Application so we can
diff --git a/aos/events/shm_event_loop.h b/aos/events/shm_event_loop.h
index 55fc85f..4460436 100644
--- a/aos/events/shm_event_loop.h
+++ b/aos/events/shm_event_loop.h
@@ -9,6 +9,9 @@
#include "aos/events/event_loop.h"
#include "aos/events/event_loop_generated.h"
+DECLARE_string(application_name);
+DECLARE_string(shm_base);
+
namespace aos {
namespace shm_event_loop_internal {
diff --git a/aos/events/shm_event_loop_test.cc b/aos/events/shm_event_loop_test.cc
index 3244c39..d25e2f8 100644
--- a/aos/events/shm_event_loop_test.cc
+++ b/aos/events/shm_event_loop_test.cc
@@ -7,9 +7,7 @@
#include "gtest/gtest.h"
#include "aos/events/test_message_generated.h"
-
-DECLARE_string(shm_base);
-DECLARE_string(override_hostname);
+#include "aos/network/team_number.h"
namespace aos {
namespace testing {
diff --git a/aos/network/message_bridge_test.cc b/aos/network/message_bridge_test.cc
index 96003f7..8d52292 100644
--- a/aos/network/message_bridge_test.cc
+++ b/aos/network/message_bridge_test.cc
@@ -7,9 +7,7 @@
#include "aos/events/pong_generated.h"
#include "aos/network/message_bridge_client_lib.h"
#include "aos/network/message_bridge_server_lib.h"
-
-DECLARE_string(override_hostname);
-DECLARE_string(application_name);
+#include "aos/network/team_number.h"
namespace aos {
namespace message_bridge {
diff --git a/aos/network/team_number.cc b/aos/network/team_number.cc
index 8d4e69e..f690943 100644
--- a/aos/network/team_number.cc
+++ b/aos/network/team_number.cc
@@ -5,11 +5,11 @@
#include <unistd.h>
#include <stdlib.h>
-#include "glog/logging.h"
-
#include "aos/util/string_to_num.h"
-DECLARE_string(override_hostname);
+DEFINE_string(override_hostname, "",
+ "If set, this forces the hostname of this node to be the provided "
+ "hostname.");
namespace aos {
namespace network {
diff --git a/aos/network/team_number.h b/aos/network/team_number.h
index 91a61f9..c2954b6 100644
--- a/aos/network/team_number.h
+++ b/aos/network/team_number.h
@@ -6,6 +6,10 @@
#include <optional>
#include <string>
+#include "glog/logging.h"
+
+DECLARE_string(override_hostname);
+
namespace aos {
namespace network {