cleaned up LOTS of build-related stuff
There were a lot of things that were relying on transitive #include
and/or gyp dependencies that I fixed.
I also got rid of all references to libaos and a lot of references to
aos/aos_core.h and its build target.
This in preparation for removing libaos completely.
diff --git a/aos/atom_code/camera/HTTPStreamer.cpp b/aos/atom_code/camera/HTTPStreamer.cpp
index ad339a8..a5d42b1 100644
--- a/aos/atom_code/camera/HTTPStreamer.cpp
+++ b/aos/atom_code/camera/HTTPStreamer.cpp
@@ -16,8 +16,9 @@
#include <vector>
#include "aos/common/Configuration.h"
-#include "aos/aos_core.h"
+#include "aos/atom_code/init.h"
#include "aos/atom_code/camera/Buffers.h"
+#include "aos/common/logging/logging.h"
namespace aos {
namespace camera {
@@ -385,4 +386,9 @@
} // namespace camera
} // namespace aos
-AOS_RUN_NRT(aos::camera::HTTPStreamer)
+int main() {
+ ::aos::InitNRT();
+ ::aos::camera::HTTPStreamer streamer;
+ streamer.Run();
+ ::aos::Cleanup();
+}
diff --git a/aos/atom_code/camera/Reader.cpp b/aos/atom_code/camera/Reader.cpp
index 2c07332..b9dc36d 100644
--- a/aos/atom_code/camera/Reader.cpp
+++ b/aos/atom_code/camera/Reader.cpp
@@ -13,9 +13,10 @@
#include <string>
#include <inttypes.h>
-#include "aos/aos_core.h"
+#include "aos/atom_code/init.h"
#include "aos/atom_code/camera/V4L2.h"
#include "aos/atom_code/camera/Buffers.h"
+#include "aos/common/logging/logging.h"
#define CLEAR(x) memset(&(x), 0, sizeof(x))
@@ -407,5 +408,9 @@
} // namespace camera
} // namespace aos
-AOS_RUN_NRT(aos::camera::Reader)
-
+int main() {
+ ::aos::InitNRT();
+ ::aos::camera::Reader reader;
+ reader.Run();
+ ::aos::Cleanup();
+}
diff --git a/aos/atom_code/camera/camera.gyp b/aos/atom_code/camera/camera.gyp
index b8e8dd3..270fb4f 100644
--- a/aos/atom_code/camera/camera.gyp
+++ b/aos/atom_code/camera/camera.gyp
@@ -7,7 +7,6 @@
'jni.cpp',
],
'dependencies': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
'<(AOS)/common/network/network.gyp:socket_so',
'<(AOS)/common/common.gyp:timing_so',
'<(AOS)/atom_code/messages/messages.gyp:messages_so',
@@ -15,7 +14,6 @@
'<(EXTERNALS):libjpeg',
],
'export_dependent_settings': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
'<(AOS)/common/network/network.gyp:socket_so',
'<(AOS)/common/common.gyp:timing_so',
'<(AOS)/atom_code/messages/messages.gyp:messages_so',
@@ -65,6 +63,7 @@
'dependencies': [
'buffers',
'<(AOS)/atom_code/atom_code.gyp:init',
+ '<(AOS)/build/aos.gyp:logging',
],
},
{
@@ -76,6 +75,7 @@
'dependencies': [
'buffers',
'<(AOS)/atom_code/atom_code.gyp:init',
+ '<(AOS)/build/aos.gyp:logging',
],
},
],
diff --git a/aos/atom_code/core/LogDisplayer.cpp b/aos/atom_code/core/LogDisplayer.cpp
index d106119..cd664f9 100644
--- a/aos/atom_code/core/LogDisplayer.cpp
+++ b/aos/atom_code/core/LogDisplayer.cpp
@@ -8,7 +8,6 @@
#include <errno.h>
#include "aos/atom_code/core/LogFileCommon.h"
-#include "aos/aos_core.h"
#include "aos/common/logging/logging_impl.h"
namespace {
diff --git a/aos/atom_code/input/JoystickInput.cpp b/aos/atom_code/input/JoystickInput.cpp
index c2a4ce2..2c3b3b9 100644
--- a/aos/atom_code/input/JoystickInput.cpp
+++ b/aos/atom_code/input/JoystickInput.cpp
@@ -1,6 +1,5 @@
#include "aos/atom_code/input/JoystickInput.h"
-#include "aos/aos_core.h"
#include "aos/common/Configuration.h"
#include "aos/common/network/ReceiveSocket.h"
#include "aos/common/messages/RobotState.q.h"
diff --git a/aos/atom_code/ipc_lib/ipc_lib.gyp b/aos/atom_code/ipc_lib/ipc_lib.gyp
index 4dd0fa9..1ff1890 100644
--- a/aos/atom_code/ipc_lib/ipc_lib.gyp
+++ b/aos/atom_code/ipc_lib/ipc_lib.gyp
@@ -26,7 +26,7 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'ipc_lib',
],
},
{
@@ -37,7 +37,7 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'ipc_lib',
],
},
{
@@ -48,7 +48,8 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'ipc_lib',
+ '<(AOS)/build/aos.gyp:logging',
],
},
],
diff --git a/aos/atom_code/ipc_lib/mutex.cpp b/aos/atom_code/ipc_lib/mutex.cpp
index 4753e78..6bf5df5 100644
--- a/aos/atom_code/ipc_lib/mutex.cpp
+++ b/aos/atom_code/ipc_lib/mutex.cpp
@@ -5,8 +5,8 @@
#include <stdio.h>
#include <string.h>
-#include "aos/aos_core.h"
#include "aos/common/type_traits.h"
+#include "aos/common/logging/logging.h"
namespace aos {
diff --git a/aos/atom_code/ipc_lib/queue_test.cpp b/aos/atom_code/ipc_lib/queue_test.cpp
index d4eb700..6fb6eca 100644
--- a/aos/atom_code/ipc_lib/queue_test.cpp
+++ b/aos/atom_code/ipc_lib/queue_test.cpp
@@ -8,7 +8,6 @@
#include "gtest/gtest.h"
-#include "aos/aos_core.h"
#include "aos/atom_code/ipc_lib/sharedmem_test_setup.h"
#include "aos/common/type_traits.h"
diff --git a/aos/atom_code/messages/messages.gyp b/aos/atom_code/messages/messages.gyp
index a5286cc..05dec59 100644
--- a/aos/atom_code/messages/messages.gyp
+++ b/aos/atom_code/messages/messages.gyp
@@ -8,11 +8,9 @@
'DriverStationDisplay.cpp',
],
'dependencies': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
'<(AOS)/build/aos.gyp:logging',
],
'export_dependent_settings': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
],
'direct_dependent_settings': {
'variables': {
diff --git a/aos/atom_code/output/HTTPServer.cpp b/aos/atom_code/output/HTTPServer.cpp
index b0d6b93..b593938 100644
--- a/aos/atom_code/output/HTTPServer.cpp
+++ b/aos/atom_code/output/HTTPServer.cpp
@@ -10,7 +10,6 @@
#include "event2/event.h"
-#include "aos/aos_core.h"
#include "aos/common/scoped_fd.h"
#include "aos/common/unique_malloc_ptr.h"
diff --git a/aos/atom_code/output/evhttp_ctemplate_emitter.cc b/aos/atom_code/output/evhttp_ctemplate_emitter.cc
index ed2a83f..9c3ac17 100644
--- a/aos/atom_code/output/evhttp_ctemplate_emitter.cc
+++ b/aos/atom_code/output/evhttp_ctemplate_emitter.cc
@@ -1,6 +1,6 @@
#include "aos/atom_code/output/evhttp_ctemplate_emitter.h"
-#include "aos/aos_core.h"
+#include "aos/common/logging/logging.h"
namespace aos {
namespace http {
diff --git a/aos/atom_code/output/motor_output.cc b/aos/atom_code/output/motor_output.cc
index 2a92437..d324da1 100644
--- a/aos/atom_code/output/motor_output.cc
+++ b/aos/atom_code/output/motor_output.cc
@@ -3,8 +3,8 @@
#include <math.h>
#include "aos/common/Configuration.h"
-#include "aos/aos_core.h"
#include "aos/common/control_loop/Timing.h"
+#include "aos/common/logging/logging.h"
namespace aos {
diff --git a/aos/atom_code/output/output.gyp b/aos/atom_code/output/output.gyp
index 2dfcd0e..6fb5956 100644
--- a/aos/atom_code/output/output.gyp
+++ b/aos/atom_code/output/output.gyp
@@ -9,13 +9,14 @@
'ctemplate_cache.cc',
],
'dependencies': [
- '<(AOS)/build/aos.gyp:libaos',
'<(EXTERNALS):libevent',
'<(EXTERNALS):ctemplate',
'<(AOS)/common/common.gyp:once',
+ '<(AOS)/common/common.gyp:common',
+ '<(AOS)/common/common.gyp:scoped_fd',
+ '<(AOS)/build/aos.gyp:logging',
],
'export_dependent_settings': [
-# Our headers #include headers from both of these.
'<(EXTERNALS):libevent',
'<(EXTERNALS):ctemplate',
],
@@ -31,6 +32,7 @@
'<(AOS)/common/common.gyp:common',
'<(AOS)/common/common.gyp:timing',
'<(EXTERNALS):WPILib-NetworkRobotValues',
+ '<(AOS)/build/aos.gyp:logging',
],
'export_dependent_settings': [
'<(AOS)/common/network/network.gyp:socket',
diff --git a/aos/common/common.gyp b/aos/common/common.gyp
index 2151064..78488b6 100644
--- a/aos/common/common.gyp
+++ b/aos/common/common.gyp
@@ -38,6 +38,7 @@
# providing a logging interface.
# '<(AOS)/build/aos.gyp:logging',
'<(AOS)/build/aos.gyp:aos/ResourceList.h',
+ 'mutex',
],
},
{
@@ -95,6 +96,19 @@
],
},
{
+ 'target_name': 'scoped_fd',
+ 'type': 'static_library',
+ 'sources': [
+ # 'scoped_fd.h'
+ ],
+ 'dependencies': [
+ '<(AOS)/build/aos.gyp:logging',
+ ],
+ 'export_dependent_settings': [
+ '<(AOS)/build/aos.gyp:logging',
+ ],
+ },
+ {
'target_name': 'control_loop_queues',
'type': 'static_library',
'sources': [ '<(AOS)/common/control_loop/control_loops.q' ],
@@ -103,7 +117,6 @@
},
'dependencies': [
'<(AOS)/common/common.gyp:queues',
- '<(AOS)/common/common.gyp:queues',
],
'includes': ['../build/queues.gypi'],
},
@@ -115,7 +128,6 @@
],
'variables': {'no_rsync': 1},
'dependencies': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
],
'direct_dependent_settings': {
'variables': {
@@ -125,7 +137,6 @@
},
},
'export_dependent_settings': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
],
},
{
@@ -135,8 +146,8 @@
'control_loop/Timing.cpp'
],
'dependencies': [
- '<(AOS)/build/aos.gyp:libaos',
'<(AOS)/build/aos.gyp:logging',
+ 'time',
],
},
{
@@ -162,13 +173,11 @@
'target_name': 'queue_test',
'type': 'executable',
'sources': [
- '<(AOS)/common/queue_test.cc',
+ 'queue_test.cc',
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
'queue_testutils',
- 'common',
'queue_test_queue',
'<(AOS)/common/util/util.gyp:thread',
],
@@ -181,8 +190,6 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
- ':common',
],
},
{
@@ -213,7 +220,7 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'once',
],
},
{
@@ -224,7 +231,8 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'time',
+ '<(AOS)/build/aos.gyp:logging',
],
},
{
@@ -254,6 +262,11 @@
],
}],
],
+ 'dependencies': [
+ # TODO(aschuh): Fix this dependency loop by
+ # providing a logging interface.
+ # '<(AOS)/build/aos.gyp:logging',
+ ],
},
{
'target_name': 'mutex_test',
@@ -263,7 +276,8 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'mutex',
+ '<(AOS)/build/aos.gyp:logging',
],
},
{
@@ -274,7 +288,7 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
+ 'die',
],
},
],
diff --git a/aos/common/network/ReceiveSocket.cpp b/aos/common/network/ReceiveSocket.cpp
index c754f32..d98be54 100644
--- a/aos/common/network/ReceiveSocket.cpp
+++ b/aos/common/network/ReceiveSocket.cpp
@@ -6,7 +6,7 @@
#include <stddef.h>
#include "aos/common/network/SocketLibraries.h"
-#include "aos/aos_core.h"
+#include "aos/common/logging/logging.h"
namespace aos {
diff --git a/aos/common/network/SendSocket.cpp b/aos/common/network/SendSocket.cpp
index c30ec32..59fd570 100644
--- a/aos/common/network/SendSocket.cpp
+++ b/aos/common/network/SendSocket.cpp
@@ -6,8 +6,8 @@
#include <stddef.h>
#include <math.h>
-#include "aos/aos_core.h"
#include "aos/common/network/SocketLibraries.h"
+#include "aos/common/logging/logging.h"
namespace aos {
diff --git a/aos/common/network/network.gyp b/aos/common/network/network.gyp
index a41509d..4fc3a09 100644
--- a/aos/common/network/network.gyp
+++ b/aos/common/network/network.gyp
@@ -10,10 +10,9 @@
'Socket.cpp',
],
'dependencies': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
+ '<(AOS)/build/aos.gyp:logging',
],
'export_dependent_settings': [
- '<(AOS)/build/aos.gyp:aos_shared_lib',
],
'conditions': [
['OS=="crio"', {
diff --git a/aos/common/scoped_fd.h b/aos/common/scoped_fd.h
index e654d3d..f31ffa5 100644
--- a/aos/common/scoped_fd.h
+++ b/aos/common/scoped_fd.h
@@ -1,4 +1,5 @@
#include "aos/common/macros.h"
+#include "aos/common/logging/logging.h"
namespace aos {
diff --git a/aos/crio/controls/JoyStickRead.cpp b/aos/crio/controls/JoyStickRead.cpp
index 1624c40..4eeed63 100644
--- a/aos/crio/controls/JoyStickRead.cpp
+++ b/aos/crio/controls/JoyStickRead.cpp
@@ -2,6 +2,7 @@
#include "WPILib/Timer.h"
#include "aos/aos_core.h"
+#include "aos/common/logging/logging.h"
#include "aos/crio/controls/ControlsManager.h"
#include "aos/common/network/SendSocket.h"
#include "aos/common/messages/RobotState.q.h"
diff --git a/aos/crio/crio.gyp b/aos/crio/crio.gyp
index 2d37999..696a832 100644
--- a/aos/crio/crio.gyp
+++ b/aos/crio/crio.gyp
@@ -10,8 +10,6 @@
],
'dependencies': [
'<(EXTERNALS):gtest',
- '<(AOS)/build/aos.gyp:libaos',
- '<(AOS)/common/common.gyp:common',
'<(AOS)/common/common.gyp:queue_test_queue',
],
},