71d969baba2ea2add27554ef16b3c1550be73a26
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / video_render / video_render.gypi
1 # Copyright (c) 2011 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       'target_name': 'video_render_module',
13       'type': 'static_library',
14       'dependencies': [
15         'webrtc_utility',
16         '<(webrtc_root)/common_video/common_video.gyp:common_video',
17         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
18       ],
19       'sources': [
20         'android/video_render_android_impl.cc',
21         'android/video_render_android_impl.h',
22         'android/video_render_android_native_opengl2.cc',
23         'android/video_render_android_native_opengl2.h',
24         'android/video_render_android_surface_view.cc',
25         'android/video_render_android_surface_view.h',
26         'android/video_render_opengles20.cc',
27         'android/video_render_opengles20.h',
28         'external/video_render_external_impl.cc',
29         'external/video_render_external_impl.h',
30         'i_video_render.h',
31         'include/video_render.h',
32         'include/video_render_defines.h',
33         'incoming_video_stream.cc',
34         'incoming_video_stream.h',
35         'ios/open_gles20.h',
36         'ios/open_gles20.mm',
37         'ios/video_render_ios_channel.h',
38         'ios/video_render_ios_channel.mm',
39         'ios/video_render_ios_gles20.h',
40         'ios/video_render_ios_gles20.mm',
41         'ios/video_render_ios_impl.h',
42         'ios/video_render_ios_impl.mm',
43         'ios/video_render_ios_view.h',
44         'ios/video_render_ios_view.mm',
45         'linux/video_render_linux_impl.cc',
46         'linux/video_render_linux_impl.h',
47         'linux/video_x11_channel.cc',
48         'linux/video_x11_channel.h',
49         'linux/video_x11_render.cc',
50         'linux/video_x11_render.h',
51         'mac/cocoa_full_screen_window.mm',
52         'mac/cocoa_full_screen_window.h',
53         'mac/cocoa_render_view.mm',
54         'mac/cocoa_render_view.h',
55         'mac/video_render_agl.cc',
56         'mac/video_render_agl.h',
57         'mac/video_render_mac_carbon_impl.cc',
58         'mac/video_render_mac_carbon_impl.h',
59         'mac/video_render_mac_cocoa_impl.h',
60         'mac/video_render_mac_cocoa_impl.mm',
61         'mac/video_render_nsopengl.h',
62         'mac/video_render_nsopengl.mm',
63         'video_render_frames.cc',
64         'video_render_frames.h',
65         'video_render_impl.cc',
66         'video_render_impl.h',
67         'windows/i_video_render_win.h',
68         'windows/video_render_direct3d9.cc',
69         'windows/video_render_direct3d9.h',
70         'windows/video_render_windows_impl.cc',
71         'windows/video_render_windows_impl.h',
72       ],
73       # TODO(andrew): with the proper suffix, these files will be excluded
74       # automatically.
75       'conditions': [
76         ['include_internal_video_render==1', {
77           'defines': ['WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER',],
78         }],
79         ['OS!="android" or include_internal_video_render==0', {
80           'sources!': [
81             'android/video_render_android_impl.h',
82             'android/video_render_android_native_opengl2.h',
83             'android/video_render_android_surface_view.h',
84             'android/video_render_opengles20.h',
85             'android/video_render_android_impl.cc',
86             'android/video_render_android_native_opengl2.cc',
87             'android/video_render_android_surface_view.cc',
88             'android/video_render_opengles20.cc',
89           ],
90         }, {
91           'link_settings': {
92             'libraries': [
93               '-lGLESv2',
94             ],
95           },
96         }],
97         ['OS!="ios" or include_internal_video_render==0', {
98           'sources!': [
99             # iOS
100             'ios/open_gles20.h',
101             'ios/open_gles20.mm',
102             'ios/video_render_ios_channel.h',
103             'ios/video_render_ios_channel.mm',
104             'ios/video_render_ios_gles20.h',
105             'ios/video_render_ios_gles20.mm',
106             'ios/video_render_ios_impl.h',
107             'ios/video_render_ios_impl.mm',
108             'ios/video_render_ios_view.h',
109             'ios/video_render_ios_view.mm',
110           ],
111         }],
112         ['OS!="linux" or include_internal_video_render==0', {
113           'sources!': [
114             'linux/video_render_linux_impl.h',
115             'linux/video_x11_channel.h',
116             'linux/video_x11_render.h',
117             'linux/video_render_linux_impl.cc',
118             'linux/video_x11_channel.cc',
119             'linux/video_x11_render.cc',
120           ],
121         }, {
122           'link_settings': {
123             'libraries': [
124               '-lXext',
125             ],
126           },
127         }],
128         ['OS!="mac" or include_internal_video_render==0', {
129           'sources!': [
130             'mac/cocoa_full_screen_window.h',
131             'mac/cocoa_render_view.h',
132             'mac/video_render_agl.h',
133             'mac/video_render_mac_carbon_impl.h',
134             'mac/video_render_mac_cocoa_impl.h',
135             'mac/video_render_nsopengl.h',
136             'mac/video_render_nsopengl.mm',
137             'mac/video_render_mac_cocoa_impl.mm',
138             'mac/video_render_agl.cc',
139             'mac/video_render_mac_carbon_impl.cc',
140             'mac/cocoa_render_view.mm',
141             'mac/cocoa_full_screen_window.mm',
142           ],
143         }],
144         ['OS=="ios"', {
145           'xcode_settings': {
146             'CLANG_ENABLE_OBJC_ARC': 'YES',
147           },
148           'all_dependent_settings': {
149             'xcode_settings': {
150               'OTHER_LDFLAGS': [
151                 '-framework OpenGLES',
152                 '-framework QuartzCore',
153                 '-framework UIKit',
154               ],
155             },
156           },
157         }],
158         ['OS=="win" and include_internal_video_render==1', {
159           'variables': {
160             # 'directx_sdk_path' will be overridden in the condition block
161             # below, but it must not be declared as empty here since gyp
162             # will check if the first character is '/' for some reason.
163             # If it's empty, we'll get an out-of-bounds error.
164             'directx_sdk_path': 'will_be_overridden',
165             'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
166             'conditions': [
167               ['"<!(python <(DEPTH)/build/dir_exists.py <(directx_sdk_default_path))"=="True"', {
168                 'directx_sdk_path': '<(DEPTH)/third_party/directxsdk/files',
169               }, {
170                 'directx_sdk_path': '$(DXSDK_DIR)',
171               }],
172             ],
173           },
174
175           'include_dirs': [
176             '<(directx_sdk_path)/Include',
177           ],
178         }],
179         ['OS!="win" or include_internal_video_render==0', {
180           'sources!': [
181             'windows/i_video_render_win.h',
182             'windows/video_render_direct3d9.h',
183             'windows/video_render_windows_impl.h',
184             'windows/video_render_direct3d9.cc',
185             'windows/video_render_windows_impl.cc',
186           ],
187         }],
188       ] # conditions
189     }, # video_render_module
190   ], # targets
191
192   'conditions': [
193     ['include_internal_video_render==1', {
194       'defines': ['WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER',],
195     }],
196     ['include_tests==1', {
197       'targets': [
198         {
199           'target_name': 'video_render_tests',
200           'type': 'executable',
201           'dependencies': [
202             'video_render_module',
203             'webrtc_utility',
204             '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
205             '<(webrtc_root)/common_video/common_video.gyp:common_video',
206           ],
207           'sources': [
208             'test/testAPI/testAPI.cc',
209             'test/testAPI/testAPI.h',
210             'test/testAPI/testAPI_android.cc',
211             'test/testAPI/testAPI_mac.mm',
212           ],
213           'conditions': [
214             ['OS=="mac" or OS=="linux"', {
215               'cflags': [
216                 '-Wno-write-strings',
217               ],
218               'ldflags': [
219                 '-lpthread -lm',
220               ],
221             }],
222             ['OS=="linux"', {
223               'link_settings': {
224                 'libraries': [
225                   '-lX11',
226                 ],
227               },
228             }],
229             ['OS=="mac"', {
230               'xcode_settings': {
231                 'OTHER_LDFLAGS': [
232                   '-framework Foundation -framework AppKit -framework Cocoa -framework OpenGL',
233                 ],
234               },
235             }],
236           ] # conditions
237         }, # video_render_module_test
238       ], # targets
239       'conditions': [
240         ['test_isolation_mode != "noop"', {
241           'targets': [
242             {
243               'target_name': 'video_render_tests_run',
244               'type': 'none',
245               'dependencies': [
246                 'video_render_tests',
247               ],
248               'includes': [
249                 '../../build/isolate.gypi',
250                 'video_render_tests.isolate',
251               ],
252               'sources': [
253                 'video_render_tests.isolate',
254               ],
255             },
256           ],
257         }],
258       ],
259     }], # include_tests==0
260   ], # conditions
261 }
262