22b8e02c4a866307af9effdd93393ad17ee42141
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / video_capture / video_capture.gypi
1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
2 #
3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS.  All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree.
8
9 {
10   'targets': [
11     {
12       # Note this library is missing an implementation for the video capture.
13       # Targets must link with either 'video_capture_module_impl' or
14       # 'video_capture_module_internal_impl' depending on whether they want to
15       # use the internal capturer.
16       'target_name': 'video_capture_module',
17       'type': 'static_library',
18       'dependencies': [
19         'webrtc_utility',
20         '<(webrtc_root)/common_video/common_video.gyp:common_video',
21         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
22       ],
23       'sources': [
24         'device_info_impl.cc',
25         'device_info_impl.h',
26         'include/video_capture.h',
27         'include/video_capture_defines.h',
28         'include/video_capture_factory.h',
29         'video_capture_config.h',
30         'video_capture_delay.h',
31         'video_capture_factory.cc',
32         'video_capture_impl.cc',
33         'video_capture_impl.h',
34       ],
35     },
36     {
37       # Default video capture module implementation that only supports external
38       # capture.
39       'target_name': 'video_capture_module_impl',
40       'type': 'static_library',
41       'dependencies': [
42         'video_capture_module',
43       ],
44       'sources': [
45         'external/device_info_external.cc',
46         'external/video_capture_external.cc',
47       ],
48     },
49     {
50       'target_name': 'video_capture_module_internal_impl',
51       'type': 'static_library',
52       'dependencies': [
53         'video_capture_module',
54       ],
55       'conditions': [
56         ['OS=="linux"', {
57           'sources': [
58             'linux/device_info_linux.cc',
59             'linux/device_info_linux.h',
60             'linux/video_capture_linux.cc',
61             'linux/video_capture_linux.h',
62           ],
63         }],  # linux
64         ['OS=="mac"', {
65           'sources': [
66             'mac/qtkit/video_capture_qtkit.h',
67             'mac/qtkit/video_capture_qtkit.mm',
68             'mac/qtkit/video_capture_qtkit_info.h',
69             'mac/qtkit/video_capture_qtkit_info.mm',
70             'mac/qtkit/video_capture_qtkit_info_objc.h',
71             'mac/qtkit/video_capture_qtkit_info_objc.mm',
72             'mac/qtkit/video_capture_qtkit_objc.h',
73             'mac/qtkit/video_capture_qtkit_objc.mm',
74             'mac/qtkit/video_capture_qtkit_utility.h',
75             'mac/video_capture_mac.mm',
76           ],
77           'link_settings': {
78             'xcode_settings': {
79               'OTHER_LDFLAGS': [
80                 '-framework Cocoa',
81                 '-framework CoreVideo',
82                 '-framework QTKit',
83               ],
84             },
85           },
86         }],  # mac
87         # Note that since winsdk_samples isn't pulled into chromium gyp will
88         # fail to parse this rule and try to resolve the dependencies. This
89         # is not a problem since the internal video capture implementation
90         # should not be used in chrome - issue 3831.
91         ['OS=="win" and build_with_chromium==0', {
92           'dependencies': [
93             '<(DEPTH)/third_party/winsdk_samples/winsdk_samples.gyp:directshow_baseclasses',
94           ],
95           'sources': [
96             'windows/device_info_ds.cc',
97             'windows/device_info_ds.h',
98             'windows/device_info_mf.cc',
99             'windows/device_info_mf.h',
100             'windows/help_functions_ds.cc',
101             'windows/help_functions_ds.h',
102             'windows/sink_filter_ds.cc',
103             'windows/sink_filter_ds.h',
104             'windows/video_capture_ds.cc',
105             'windows/video_capture_ds.h',
106             'windows/video_capture_factory_windows.cc',
107             'windows/video_capture_mf.cc',
108             'windows/video_capture_mf.h',
109           ],
110           'link_settings': {
111             'libraries': [
112               '-lStrmiids.lib',
113             ],
114           },
115         }],  # win
116         ['OS=="android"', {
117           'dependencies': [
118             '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
119             '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
120           ],
121           'sources': [
122             'android/device_info_android.cc',
123             'android/device_info_android.h',
124             'android/video_capture_android.cc',
125             'android/video_capture_android.h',
126           ],
127         }],  # android
128         ['OS=="ios"', {
129           'sources': [
130             'ios/device_info_ios.h',
131             'ios/device_info_ios.mm',
132             'ios/device_info_ios_objc.h',
133             'ios/device_info_ios_objc.mm',
134             'ios/rtc_video_capture_ios_objc.h',
135             'ios/rtc_video_capture_ios_objc.mm',
136             'ios/video_capture_ios.h',
137             'ios/video_capture_ios.mm',
138           ],
139           'xcode_settings': {
140             'CLANG_ENABLE_OBJC_ARC': 'YES',
141           },
142           'all_dependent_settings': {
143             'xcode_settings': {
144               'OTHER_LDFLAGS': [
145                 '-framework AVFoundation',
146                 '-framework CoreMedia',
147                 '-framework CoreVideo',
148                 '-framework UIKit',
149               ],
150             },
151           },
152         }],  # ios
153       ], # conditions
154     }
155   ],
156   'conditions': [
157     ['include_tests==1', {
158       'targets': [
159         {
160           'target_name': 'video_capture_tests',
161           'type': '<(gtest_target_type)',
162           'dependencies': [
163             'video_capture_module',
164             'video_capture_module_internal_impl',
165             'webrtc_utility',
166             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
167             '<(DEPTH)/testing/gtest.gyp:gtest',
168           ],
169           'sources': [
170             'ensure_initialized.cc',
171             'ensure_initialized.h',
172             'test/video_capture_unittest.cc',
173             'test/video_capture_main_mac.mm',
174           ],
175           'conditions': [
176             ['OS=="mac" or OS=="linux"', {
177               'cflags': [
178                 '-Wno-write-strings',
179               ],
180               'ldflags': [
181                 '-lpthread -lm',
182               ],
183             }],
184             ['OS=="linux"', {
185               'libraries': [
186                 '-lrt',
187                 '-lXext',
188                 '-lX11',
189               ],
190             }],
191             ['OS=="android"', {
192               'dependencies': [
193                 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
194               ],
195               # Need to disable error due to the line in
196               # base/android/jni_android.h triggering it:
197               # const BASE_EXPORT jobject GetApplicationContext()
198               # error: type qualifiers ignored on function return type
199               'cflags': [
200                 '-Wno-ignored-qualifiers',
201               ],
202             }],
203             ['OS=="mac"', {
204               'dependencies': [
205                 # Link with a special main for mac so we can use the webcam.
206                 '<(webrtc_root)/test/test.gyp:test_support_main_threaded_mac',
207               ],
208               'xcode_settings': {
209                 # TODO(andrew): CoreAudio and AudioToolbox shouldn't be needed.
210                 'OTHER_LDFLAGS': [
211                   '-framework Foundation -framework AppKit -framework Cocoa -framework OpenGL -framework CoreVideo -framework CoreAudio -framework AudioToolbox',
212                 ],
213               },
214             }], # OS=="mac"
215             ['OS!="mac"', {
216               'dependencies': [
217                 # Otherwise, use the regular main.
218                 '<(webrtc_root)/test/test.gyp:test_support_main',
219               ],
220             }], # OS!="mac"
221           ] # conditions
222         },
223       ], # targets
224       'conditions': [
225         ['OS=="android"', {
226           'targets': [
227             {
228               'target_name': 'video_capture_tests_apk_target',
229               'type': 'none',
230               'dependencies': [
231                 '<(apk_tests_path):video_capture_tests_apk',
232               ],
233             },
234           ],
235         }],
236         ['test_isolation_mode != "noop"', {
237           'targets': [
238             {
239               'target_name': 'video_capture_tests_run',
240               'type': 'none',
241               'dependencies': [
242                 'video_capture_tests',
243               ],
244               'includes': [
245                 '../../build/isolate.gypi',
246               ],
247               'sources': [
248                 'video_capture_tests.isolate',
249               ],
250             },
251           ],
252         }],
253       ],
254     }],
255   ],
256 }
257