Merge branch 'crio-compiling-switch' into network-robot-new
diff --git a/aos/build/aos.gyp b/aos/build/aos.gyp
index 7d570fd..9e464a5 100644
--- a/aos/build/aos.gyp
+++ b/aos/build/aos.gyp
@@ -104,17 +104,22 @@
       'dependencies': [
         '<(AOS)/common/messages/messages.gyp:aos_queues',
         'logging',
-        '<(EXTERNALS):WPILib',
       ],
       'export_dependent_settings': [
         '<(AOS)/common/messages/messages.gyp:aos_queues',
-        '<(EXTERNALS):WPILib',
       ],
       'conditions': [
         ['OS=="atom"', {
           'dependencies': [
             '<(AOS)/atom_code/ipc_lib/ipc_lib.gyp:ipc_lib',
           ],
+        }, {
+          'dependencies': [
+            '<(EXTERNALS):WPILib',
+          ],
+          'export_dependent_settings': [
+            '<(EXTERNALS):WPILib',
+          ],
         }]
       ],
     },
@@ -128,13 +133,22 @@
         '<(AOS)/common/messages/messages.gyp:queues_so',
         '<(AOS)/common/common.gyp:queues',
         'aos_swig',
-        '<(EXTERNALS):WPILib',
       ],
       'export_dependent_settings': [
         '<(AOS)/common/messages/messages.gyp:queues_so',
-        '<(EXTERNALS):WPILib',
         'aos_swig',
       ],
+      'conditions': [
+        ['OS=="atom"', {
+        }, {
+          'dependencies': [
+            '<(EXTERNALS):WPILib',
+          ],
+          'export_dependent_settings': [
+            '<(EXTERNALS):WPILib',
+          ],
+        }]
+      ],
       'direct_dependent_settings': {
         'variables': {
           'jni_libs': [
@@ -151,11 +165,9 @@
       'type': 'none',
       'dependencies': [
         'aos/ResourceList.h',
-        '<(EXTERNALS):WPILib',
       ],
       'export_dependent_settings': [
         'aos/ResourceList.h',
-        '<(EXTERNALS):WPILib',
       ],
     },
     {
diff --git a/aos/build/externals.gyp b/aos/build/externals.gyp
index 958f823..0daa229 100644
--- a/aos/build/externals.gyp
+++ b/aos/build/externals.gyp
@@ -17,22 +17,30 @@
   },
   'targets': [
     {
-# does nothing when OS!="crio"
       'target_name': 'WPILib',
-      'type': 'none',
-      'conditions': [['OS=="crio"', {
-            'direct_dependent_settings': {
-              'cflags': [
-                '-isystem', '<(aos_abs)/externals/WPILib',
-                '-isystem', '<(aos_abs)/externals/WPILib/WPILib',
-              ],
-              'link_settings': {
-                'libraries': [
-                  #'<(aos_abs)/externals/WPILib/WPILib.a',
-                ],
-              },
-            },
-        }]],
+      'type': 'static_library',
+      'sources': [
+        '<!@(find <(externals)/WPILib/WPILib/ -name *.cpp)',
+      ],
+      'cflags!': [
+        '-Werror',
+        '-ggdb3',
+        '-O0'
+      ],
+      'cflags': [
+        '-ggdb1',
+        '-O3'
+      ],
+      'include_dirs': [
+        '<(externals)/WPILib',
+        '<(externals)/WPILib/WPILib',
+      ],
+      'direct_dependent_settings': {
+        'cflags': [
+          '-isystem', '<(externals_abs)/WPILib',
+          '-isystem', '<(externals_abs)/WPILib/WPILib',
+        ],
+      },
     },
     {
       'target_name': 'onejar',
diff --git a/aos/common/control_loop/ControlLoop.h b/aos/common/control_loop/ControlLoop.h
index e47e0ad..723d766 100644
--- a/aos/common/control_loop/ControlLoop.h
+++ b/aos/common/control_loop/ControlLoop.h
@@ -3,7 +3,6 @@
 
 #include <cstring>
 
-#include "aos/aos_core.h"
 #include "aos/common/control_loop/Timing.h"
 #include "aos/common/type_traits.h"
 #include "aos/common/queue.h"
diff --git a/aos/common/messages/messages.gyp b/aos/common/messages/messages.gyp
index 434281d..b1ab1d2 100644
--- a/aos/common/messages/messages.gyp
+++ b/aos/common/messages/messages.gyp
@@ -37,11 +37,9 @@
         'header_path': 'aos/common/messages',
       },
       'dependencies': [
-        '<(EXTERNALS):WPILib',
         '<(AOS)/common/common.gyp:queues',
       ],
       'export_dependent_settings': [
-        '<(EXTERNALS):WPILib',
         '<(AOS)/common/common.gyp:queues',
       ],
       'includes': ['../../build/queues.gypi'],
diff --git a/frc971/crio/crio.gyp b/frc971/crio/crio.gyp
index e25eb08..62d88bc 100644
--- a/frc971/crio/crio.gyp
+++ b/frc971/crio/crio.gyp
@@ -4,15 +4,10 @@
 # The WPILib code that we've modified.
       'target_name': 'WPILib_changes',
       'type': 'static_library',
-      'sources': [
-        '<!@(find <(AOS)/externals/WPILib/WPILib/ -name *.cpp)',
-      ],
       'dependencies': [
         '<(EXTERNALS):WPILib',
         '<(EXTERNALS):libgcc-4.5.2',
       ],
-      'cflags!': ['-Werror', '-ggdb3', '-O0'],
-      'cflags': ['-ggdb1', '-O3'],
     },
     {
       'target_name': 'user_program',