sanified deciding whether to compile with debugging or not
diff --git a/aos/build/aos.gypi b/aos/build/aos.gypi
index bf4ce80..9f19cda 100644
--- a/aos/build/aos.gypi
+++ b/aos/build/aos.gypi
@@ -113,10 +113,16 @@
     },
     'conditions': [
       ['DEBUG=="yes"', {
+          'defines': [
+            'AOS_DEBUG=1',
+          ],
           'cflags': [
             '-O0',
           ],
         }, {
+          'defines': [
+            'AOS_DEBUG=0',
+          ],
           'cflags': [
             # TODO(brians): add -flto
             '-O3',
diff --git a/aos/common/common.gyp b/aos/common/common.gyp
index d53b75f..d3ac124 100644
--- a/aos/common/common.gyp
+++ b/aos/common/common.gyp
@@ -163,8 +163,6 @@
         'test_queue',
         '<(AOS)/common/util/util.gyp:thread',
         'die',
-        # We want to run it with the assertions etc to try and catch bugs there.
-        '<(AOS)/linux_code/ipc_lib/ipc_lib.gyp:queue_debug',
       ],
     },
     {
diff --git a/aos/linux_code/ipc_lib/ipc_lib.gyp b/aos/linux_code/ipc_lib/ipc_lib.gyp
index 68cd13b..fe8b2e0 100644
--- a/aos/linux_code/ipc_lib/ipc_lib.gyp
+++ b/aos/linux_code/ipc_lib/ipc_lib.gyp
@@ -46,26 +46,6 @@
         'core_lib',
         '<(AOS)/build/aos.gyp:logging_interface',
       ],
-      'defines': [
-        'QUEUE_DEBUG=0',
-      ],
-    },
-    # A version of the queue code compiled with assertions enabled etc.
-    {
-      'target_name': 'queue_debug',
-      'type': 'static_library',
-      'sources': [
-        'queue.cc',
-      ],
-      'dependencies': [
-        'queue',
-      ],
-      'export_dependent_settings': [
-        'queue',
-      ],
-      'defines': [
-        'QUEUE_DEBUG=1',
-      ],
     },
     {
       'target_name': 'raw_queue_test',
@@ -75,7 +55,7 @@
       ],
       'dependencies': [
         '<(EXTERNALS):gtest',
-        'queue_debug',
+        'queue',
         '<(AOS)/build/aos.gyp:logging',
         'core_lib',
         '<(AOS)/common/common.gyp:queue_testutils',
diff --git a/aos/linux_code/ipc_lib/queue.cc b/aos/linux_code/ipc_lib/queue.cc
index 3cdb74c..4025554 100644
--- a/aos/linux_code/ipc_lib/queue.cc
+++ b/aos/linux_code/ipc_lib/queue.cc
@@ -1,4 +1,4 @@
-#if !QUEUE_DEBUG
+#if !AOS_DEBUG
 #define NDEBUG
 #endif
 
@@ -564,7 +564,7 @@
 }
 
 bool RawQueue::IsDebug() {
-#if QUEUE_DEBUG
+#if AOS_DEBUG
   return true;
 #else
   return false;