Consolidate common_video targets to improve gyp run time.

Not sure if this change is measurable; perhaps a 1% savings.

BUG=webrtc:34

Review URL: https://webrtc-codereview.appspot.com/785005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2732 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/src/common_video/common_video.gyp b/src/common_video/common_video.gyp
index 3adb56c..31b0b5e 100644
--- a/src/common_video/common_video.gyp
+++ b/src/common_video/common_video.gyp
@@ -7,9 +7,69 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 {
-  'includes': [
-    '../build/common.gypi',
-    'libyuv/libyuv.gypi',
-    'jpeg/jpeg.gypi',
+  'includes': ['../build/common.gypi'],
+  'targets': [
+    {
+      'target_name': 'common_video',
+      'type': 'static_library',
+      'include_dirs': [
+        '<(webrtc_root)/modules/interface/',
+        'interface',
+        'jpeg/include',
+        'libyuv/include',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          'interface',
+          'jpeg/include',
+          'libyuv/include',
+        ],
+      },
+      'conditions': [
+        ['build_libjpeg==1', {
+          'dependencies': ['<(libjpeg_gyp_path):libjpeg',],
+        }, {
+          # Need to add a directory normally exported by libjpeg.gyp.
+          'include_dirs': ['<(libjpeg_include_dir)'],
+        }],
+        ['build_libyuv==1', {
+          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
+        }, {
+          # Need to add a directory normally exported by libyuv.gyp.
+          'include_dirs': ['<(libyuv_dir)/include',],
+        }],
+      ],
+      'sources': [
+        'jpeg/include/jpeg.h',
+        'jpeg/data_manager.cc',
+        'jpeg/data_manager.h',
+        'jpeg/jpeg.cc',
+        'libyuv/include/webrtc_libyuv.h',
+        'libyuv/include/scaler.h',
+        'libyuv/webrtc_libyuv.cc',
+        'libyuv/scaler.cc',
+      ],
+    },
+  ],  # targets
+  'conditions': [
+    ['include_tests==1', {
+      'targets': [
+        {
+          'target_name': 'common_video_unittests',
+          'type': 'executable',
+          'dependencies': [
+             'common_video',
+             '<(DEPTH)/testing/gtest.gyp:gtest',
+             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
+             '<(webrtc_root)/test/test.gyp:test_support_main',
+          ],
+          'sources': [
+            'jpeg/jpeg_unittest.cc',
+            'libyuv/libyuv_unittest.cc',
+            'libyuv/scaler_unittest.cc',
+          ],
+        },
+      ],  # targets
+    }],  # include_tests
   ],
 }
diff --git a/src/common_video/jpeg/jpeg.gypi b/src/common_video/jpeg/jpeg.gypi
deleted file mode 100644
index 80f3f62..0000000
--- a/src/common_video/jpeg/jpeg.gypi
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
-#
-# Use of this source code is governed by a BSD-style license
-# that can be found in the LICENSE file in the root of the source
-# tree. An additional intellectual property rights grant can be found
-# in the file PATENTS.  All contributing project authors may
-# be found in the AUTHORS file in the root of the source tree.
-
-{
-  'variables': {
-    'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
-    'conditions': [
-      ['use_libjpeg_turbo==1', {
-        'libjpeg_include_dir%': [ '<(DEPTH)/third_party/libjpeg_turbo', ],
-      }, {
-        'libjpeg_include_dir%': [ '<(DEPTH)/third_party/libjpeg', ],
-      }],
-    ],
-  },
-  'targets': [
-    {
-      'target_name': 'webrtc_jpeg',
-      'type': '<(library)',
-      'dependencies': [
-        'webrtc_libyuv',
-      ],
-      'include_dirs': [
-        'include',
-        '<(webrtc_root)',
-        '<(webrtc_root)/common_video/interface',
-        '<(webrtc_root)/modules/interface/',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          'include',
-          '<(webrtc_root)/common_video/interface',
-        ],
-      },
-      'conditions': [
-        ['build_libjpeg==1', {
-          'dependencies': [
-            '<(libjpeg_gyp_path):libjpeg',
-          ],
-        }, {
-          # Need to add a directory normally exported by libjpeg.gyp.
-          'include_dirs': [ '<(libjpeg_include_dir)' ],
-        }],
-      ],
-      'sources': [
-        'include/jpeg.h',
-        'data_manager.cc',
-        'data_manager.h',
-        'jpeg.cc',
-      ],
-    },
-  ], # targets
-  'conditions': [
-    ['include_tests==1', {
-      'targets': [
-        {
-          'target_name': 'jpeg_unittests',
-          'type': 'executable',
-          'dependencies': [
-             'webrtc_jpeg',
-             '<(DEPTH)/testing/gtest.gyp:gtest',
-             '<(webrtc_root)/test/test.gyp:test_support_main',
-          ],
-          'sources': [
-            'jpeg_unittest.cc',
-          ],
-        },
-      ] # targets
-    }], # include_tests
-  ], # conditions
-}
-
-# Local Variables:
-# tab-width:2
-# indent-tabs-mode:nil
-# End:
-# vim: set expandtab tabstop=2 shiftwidth=2:
diff --git a/src/common_video/libyuv/libyuv.gypi b/src/common_video/libyuv/libyuv.gypi
deleted file mode 100644
index 77aba19..0000000
--- a/src/common_video/libyuv/libyuv.gypi
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
-#
-# Use of this source code is governed by a BSD-style license
-# that can be found in the LICENSE file in the root of the source
-# tree. An additional intellectual property rights grant can be found
-# in the file PATENTS.  All contributing project authors may
-# be found in the AUTHORS file in the root of the source tree.
-
-{
-  'targets': [
-    {
-      'target_name': 'webrtc_libyuv',
-      'type': '<(library)',
-      'conditions': [
-        ['build_libyuv==1', {
-          'dependencies': [
-            '<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv'
-          ],
-        }, {
-          # Need to add a directory normally exported by libyuv.gyp.
-          'include_dirs': [ '<(libyuv_dir)/include', ],
-        }],
-      ],
-      'sources': [
-        'include/webrtc_libyuv.h',
-        'include/scaler.h',
-        'webrtc_libyuv.cc',
-        'scaler.cc',
-      ],
-    },
-  ], # targets
-  'conditions': [
-    ['include_tests==1', {
-      'targets': [
-        {
-          'target_name': 'libyuv_unittests',
-          'type': 'executable',
-          'dependencies': [
-            'webrtc_libyuv',
-            '<(DEPTH)/testing/gtest.gyp:gtest',
-            '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
-            '<(webrtc_root)/test/test.gyp:test_support_main',
-          ],
-          'sources': [
-            'libyuv_unittest.cc',
-            'scaler_unittest.cc',
-          ],
-        },
-      ], # targets
-    }], # include_tests
-  ], # conditions
-}
diff --git a/src/modules/video_capture/main/source/video_capture.gypi b/src/modules/video_capture/main/source/video_capture.gypi
index f3fb826..5581df3 100644
--- a/src/modules/video_capture/main/source/video_capture.gypi
+++ b/src/modules/video_capture/main/source/video_capture.gypi
@@ -13,7 +13,7 @@
       'type': '<(library)',
       'dependencies': [
         'webrtc_utility',
-        '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
       ],
       'include_dirs': [
diff --git a/src/modules/video_coding/codecs/test_framework/test_framework.gypi b/src/modules/video_coding/codecs/test_framework/test_framework.gypi
index 67b262f..fed82b4 100644
--- a/src/modules/video_coding/codecs/test_framework/test_framework.gypi
+++ b/src/modules/video_coding/codecs/test_framework/test_framework.gypi
@@ -16,7 +16,7 @@
 
           'dependencies': [
             '<(DEPTH)/testing/gtest.gyp:gtest',
-            '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+            '<(webrtc_root)/common_video/common_video.gyp:common_video',
             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
             '<(webrtc_root)/test/metrics.gyp:metrics',
             '<(webrtc_root)/test/test.gyp:test_support',
diff --git a/src/modules/video_coding/codecs/vp8/vp8.gyp b/src/modules/video_coding/codecs/vp8/vp8.gyp
index 33574b4..dbb1457 100644
--- a/src/modules/video_coding/codecs/vp8/vp8.gyp
+++ b/src/modules/video_coding/codecs/vp8/vp8.gyp
@@ -17,7 +17,7 @@
       'type': '<(library)',
       'dependencies': [
         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
-        '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
       ],
       'include_dirs': [
         'include',
@@ -73,7 +73,7 @@
           'dependencies': [
             'test_framework',
             'webrtc_vp8',
-            '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+            '<(webrtc_root)/common_video/common_video.gyp:common_video',
             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
             '<(webrtc_root)/test/test.gyp:test_support',
             '<(webrtc_root)/test/test.gyp:test_support_main',
diff --git a/src/modules/video_coding/main/source/video_coding.gypi b/src/modules/video_coding/main/source/video_coding.gypi
index b26cf5a..c995072 100644
--- a/src/modules/video_coding/main/source/video_coding.gypi
+++ b/src/modules/video_coding/main/source/video_coding.gypi
@@ -13,7 +13,7 @@
       'type': '<(library)',
       'dependencies': [
         'webrtc_i420',
-        '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
         '<(webrtc_vp8_dir)/vp8.gyp:webrtc_vp8',
       ],
diff --git a/src/modules/video_coding/main/source/video_coding_test.gypi b/src/modules/video_coding/main/source/video_coding_test.gypi
index eb9dbe4..72e9ad3 100644
--- a/src/modules/video_coding/main/source/video_coding_test.gypi
+++ b/src/modules/video_coding/main/source/video_coding_test.gypi
@@ -18,7 +18,7 @@
          'rtp_rtcp',
          'webrtc_utility',
          'video_processing',
-         '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+         '<(webrtc_root)/common_video/common_video.gyp:common_video',
       ],
       'include_dirs': [
          '../../../interface',
diff --git a/src/modules/video_processing/main/source/video_processing.gypi b/src/modules/video_processing/main/source/video_processing.gypi
index 3bc03bc..8d70a79 100644
--- a/src/modules/video_processing/main/source/video_processing.gypi
+++ b/src/modules/video_processing/main/source/video_processing.gypi
@@ -14,7 +14,7 @@
       'dependencies': [
         'webrtc_utility',
         '<(webrtc_root)/common_audio/common_audio.gyp:signal_processing',
-        '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
       ],
       'include_dirs': [
diff --git a/src/modules/video_render/main/source/video_render.gypi b/src/modules/video_render/main/source/video_render.gypi
index ea1eefa..12e7b21f 100644
--- a/src/modules/video_render/main/source/video_render.gypi
+++ b/src/modules/video_render/main/source/video_render.gypi
@@ -13,7 +13,7 @@
       'type': '<(library)',
       'dependencies': [
         'webrtc_utility',
-        '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
       ],
       'include_dirs': [
@@ -174,7 +174,7 @@
             'video_render_module',
             'webrtc_utility',
             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
-            '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+            '<(webrtc_root)/common_video/common_video.gyp:common_video',
           ],
           'sources': [
             '../test/testAPI/testAPI.cc',
diff --git a/src/test/metrics.gyp b/src/test/metrics.gyp
index 11573ae..f4c3e2d 100644
--- a/src/test/metrics.gyp
+++ b/src/test/metrics.gyp
@@ -20,7 +20,7 @@
       'target_name': 'metrics',
       'type': '<(library)',
       'dependencies': [
-        '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
       ],
       'include_dirs': [
         '.',
diff --git a/src/video_engine/video_engine_core.gypi b/src/video_engine/video_engine_core.gypi
index 43143f3..00acea0 100644
--- a/src/video_engine/video_engine_core.gypi
+++ b/src/video_engine/video_engine_core.gypi
@@ -21,8 +21,7 @@
       'dependencies': [
 
         # common_video
-       '<(webrtc_root)/common_video/common_video.gyp:webrtc_libyuv',
-       '<(webrtc_root)/common_video/common_video.gyp:webrtc_jpeg',
+       '<(webrtc_root)/common_video/common_video.gyp:common_video',
 
         # ModulesShared
         '<(webrtc_root)/modules/modules.gyp:media_file',