f2cadd6ddf063231e27c5712d2b9bbc7d06da0f6
[platform/framework/web/crosswalk.git] / src / xwalk / xwalk.gyp
1 {
2   'variables': {
3     'xwalk_product_name': 'XWalk',
4     'xwalk_version': '<!(python ../build/util/version.py -f VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
5     'chrome_version': '<!(python ../build/util/version.py -f ../chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
6     'conditions': [
7       ['OS=="win" or OS=="mac"', {
8         'disable_nacl': 1,
9       }],
10     ], # conditions
11   },
12   'includes' : [
13     'xwalk_tests.gypi',
14     'application/xwalk_application.gypi',
15   ],
16   'targets': [
17     {
18       'target_name': 'xwalk_runtime',
19       'type': 'static_library',
20       'defines!': ['CONTENT_IMPLEMENTATION'],
21       'defines': ['XWALK_VERSION="<(xwalk_version)"','CHROME_VERSION="<(chrome_version)"'],
22       'variables': {
23         'chromium_code': 1,
24       },
25       'dependencies': [
26         '../base/base.gyp:base',
27         '../base/base.gyp:base_i18n',
28         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
29         '../cc/cc.gyp:cc',
30         '../components/components.gyp:visitedlink_browser',
31         '../components/components.gyp:visitedlink_renderer',
32         '../content/content.gyp:content',
33         '../content/content.gyp:content_app_both',
34         '../content/content.gyp:content_browser',
35         '../content/content.gyp:content_common',
36         '../content/content.gyp:content_gpu',
37         '../content/content.gyp:content_plugin',
38         '../content/content.gyp:content_ppapi_plugin',
39         '../content/content.gyp:content_renderer',
40         '../content/content.gyp:content_utility',
41         '../ipc/ipc.gyp:ipc',
42         '../media/media.gyp:media',
43         '../net/net.gyp:net',
44         '../net/net.gyp:net_resources',
45         '../skia/skia.gyp:skia',
46         '../storage/storage_browser.gyp:storage',
47         '../storage/storage_common.gyp:storage_common',
48         '../third_party/WebKit/public/blink.gyp:blink',
49         '../ui/base/ui_base.gyp:ui_base',
50         '../ui/gl/gl.gyp:gl',
51         '../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
52         '../ui/snapshot/snapshot.gyp:snapshot',
53         '../url/url.gyp:url_lib',
54         '../v8/tools/gyp/v8.gyp:v8',
55         'generate_upstream_blink_version',
56         'xwalk_application_lib',
57         'xwalk_resources',
58         'extensions/extensions.gyp:xwalk_extensions',
59         'sysapps/sysapps.gyp:sysapps',
60       ],
61       'include_dirs': [
62         '..',
63       ],
64       'sources': [
65         '../extensions/common/constants.cc',
66         '../extensions/common/constants.h',
67         '../extensions/common/url_pattern.cc',
68         '../extensions/common/url_pattern.h',
69         'experimental/native_file_system/native_file_system_extension.cc',
70         'experimental/native_file_system/native_file_system_extension.h',
71         'experimental/native_file_system/virtual_root_provider_mac.cc',
72         'experimental/native_file_system/virtual_root_provider_win.cc',
73         'experimental/native_file_system/virtual_root_provider.cc',
74         'experimental/native_file_system/virtual_root_provider.h',
75         'runtime/app/android/xwalk_main_delegate_android.cc',
76         'runtime/app/android/xwalk_main_delegate_android.h',
77         'runtime/app/xwalk_main_delegate.cc',
78         'runtime/app/xwalk_main_delegate.h',
79         'runtime/browser/android/cookie_manager.cc',
80         'runtime/browser/android/cookie_manager.h',
81         'runtime/browser/android/intercepted_request_data.h',
82         'runtime/browser/android/intercepted_request_data_impl.cc',
83         'runtime/browser/android/intercepted_request_data_impl.h',
84         'runtime/browser/android/net/android_protocol_handler.cc',
85         'runtime/browser/android/net/android_protocol_handler.h',
86         'runtime/browser/android/net/android_stream_reader_url_request_job.cc',
87         'runtime/browser/android/net/android_stream_reader_url_request_job.h',
88         'runtime/browser/android/net/input_stream.h',
89         'runtime/browser/android/net/input_stream_impl.cc',
90         'runtime/browser/android/net/input_stream_impl.h',
91         'runtime/browser/android/net/input_stream_reader.cc',
92         'runtime/browser/android/net/input_stream_reader.h',
93         'runtime/browser/android/net/url_constants.cc',
94         'runtime/browser/android/net/url_constants.h',
95         'runtime/browser/android/net/xwalk_url_request_job_factory.cc',
96         'runtime/browser/android/net/xwalk_url_request_job_factory.h',
97         'runtime/browser/android/net_disk_cache_remover.cc',
98         'runtime/browser/android/net_disk_cache_remover.h',
99         'runtime/browser/android/renderer_host/xwalk_render_view_host_ext.cc',
100         'runtime/browser/android/renderer_host/xwalk_render_view_host_ext.h',
101         'runtime/browser/android/state_serializer.cc',
102         'runtime/browser/android/state_serializer.h',
103         'runtime/browser/android/xwalk_content.cc',
104         'runtime/browser/android/xwalk_content.h',
105         'runtime/browser/android/xwalk_contents_client_bridge.cc',
106         'runtime/browser/android/xwalk_contents_client_bridge.h',
107         'runtime/browser/android/xwalk_contents_client_bridge_base.cc',
108         'runtime/browser/android/xwalk_contents_client_bridge_base.h',
109         'runtime/browser/android/xwalk_contents_io_thread_client.h',
110         'runtime/browser/android/xwalk_contents_io_thread_client_impl.cc',
111         'runtime/browser/android/xwalk_contents_io_thread_client_impl.h',
112         'runtime/browser/android/xwalk_cookie_access_policy.cc',
113         'runtime/browser/android/xwalk_cookie_access_policy.h',
114         'runtime/browser/android/xwalk_dev_tools_server.cc',
115         'runtime/browser/android/xwalk_dev_tools_server.h',
116         'runtime/browser/android/xwalk_download_resource_throttle.cc',
117         'runtime/browser/android/xwalk_download_resource_throttle.h',
118         'runtime/browser/android/xwalk_http_auth_handler.cc',
119         'runtime/browser/android/xwalk_http_auth_handler.h',
120         'runtime/browser/android/xwalk_http_auth_handler_base.cc',
121         'runtime/browser/android/xwalk_http_auth_handler_base.h',
122         'runtime/browser/android/xwalk_login_delegate.cc',
123         'runtime/browser/android/xwalk_login_delegate.h',
124         'runtime/browser/android/xwalk_path_helper.cc',
125         'runtime/browser/android/xwalk_path_helper.h',
126         'runtime/browser/android/xwalk_icon_helper.cc',
127         'runtime/browser/android/xwalk_icon_helper.h',
128         'runtime/browser/android/xwalk_request_interceptor.cc',
129         'runtime/browser/android/xwalk_request_interceptor.h',
130         'runtime/browser/android/xwalk_settings.cc',
131         'runtime/browser/android/xwalk_view_delegate.cc',
132         'runtime/browser/android/xwalk_view_delegate.h',
133         'runtime/browser/android/xwalk_web_contents_delegate.cc',
134         'runtime/browser/android/xwalk_web_contents_delegate.h',
135         'runtime/browser/android/xwalk_web_contents_view_delegate.cc',
136         'runtime/browser/android/xwalk_web_contents_view_delegate.h',
137         'runtime/browser/application_component.cc',
138         'runtime/browser/application_component.h',
139         'runtime/browser/devtools/remote_debugging_server.cc',
140         'runtime/browser/devtools/remote_debugging_server.h',
141         'runtime/browser/devtools/xwalk_devtools_delegate.cc',
142         'runtime/browser/devtools/xwalk_devtools_delegate.h',
143         'runtime/browser/geolocation/tizen/location_provider_tizen.cc',
144         'runtime/browser/geolocation/tizen/location_provider_tizen.h',
145         'runtime/browser/geolocation/xwalk_access_token_store.cc',
146         'runtime/browser/geolocation/xwalk_access_token_store.h',
147         'runtime/browser/image_util.cc',
148         'runtime/browser/image_util.h',
149         'runtime/browser/media/media_capture_devices_dispatcher.cc',
150         'runtime/browser/media/media_capture_devices_dispatcher.h',
151         'runtime/browser/renderer_host/pepper/xwalk_browser_pepper_host_factory.cc',
152         'runtime/browser/renderer_host/pepper/xwalk_browser_pepper_host_factory.h',
153         'runtime/browser/runtime.cc',
154         'runtime/browser/runtime.h',
155         'runtime/browser/runtime_context.cc',
156         'runtime/browser/runtime_context.h',
157         'runtime/browser/runtime_defered_ui_strategy.cc',
158         'runtime/browser/runtime_defered_ui_strategy.h',
159         'runtime/browser/runtime_download_manager_delegate.cc',
160         'runtime/browser/runtime_download_manager_delegate.h',
161         'runtime/browser/runtime_file_select_helper.cc',
162         'runtime/browser/runtime_file_select_helper.h',
163         'runtime/browser/runtime_geolocation_permission_context.cc',
164         'runtime/browser/runtime_geolocation_permission_context.h',
165         'runtime/browser/runtime_javascript_dialog_manager.cc',
166         'runtime/browser/runtime_javascript_dialog_manager.h',
167         'runtime/browser/runtime_network_delegate.cc',
168         'runtime/browser/runtime_network_delegate.h',
169         'runtime/browser/runtime_platform_util.h',
170         'runtime/browser/runtime_platform_util_android.cc',
171         'runtime/browser/runtime_platform_util_aura.cc',
172         'runtime/browser/runtime_platform_util_linux.cc',
173         'runtime/browser/runtime_platform_util_mac.mm',
174         'runtime/browser/runtime_platform_util_tizen.cc',
175         'runtime/browser/runtime_platform_util_win.cc',
176         'runtime/browser/runtime_quota_permission_context.cc',
177         'runtime/browser/runtime_quota_permission_context.h',
178         'runtime/browser/runtime_resource_dispatcher_host_delegate.cc',
179         'runtime/browser/runtime_resource_dispatcher_host_delegate.h',
180         'runtime/browser/runtime_resource_dispatcher_host_delegate_android.cc',
181         'runtime/browser/runtime_resource_dispatcher_host_delegate_android.h',
182         'runtime/browser/runtime_select_file_policy.cc',
183         'runtime/browser/runtime_select_file_policy.h',
184         'runtime/browser/runtime_ui_strategy.cc',
185         'runtime/browser/runtime_ui_strategy.h',
186         'runtime/browser/runtime_url_request_context_getter.cc',
187         'runtime/browser/runtime_url_request_context_getter.h',
188         'runtime/browser/speech/speech_recognition_manager_delegate.cc',
189         'runtime/browser/speech/speech_recognition_manager_delegate.h',
190         'runtime/browser/sysapps_component.cc',
191         'runtime/browser/sysapps_component.h',
192         'runtime/browser/storage_component.cc',
193         'runtime/browser/storage_component.h',
194         'runtime/browser/ui/color_chooser.cc',
195         'runtime/browser/ui/color_chooser.h',
196         'runtime/browser/ui/color_chooser_android.cc',
197         'runtime/browser/ui/color_chooser_aura.cc',
198         'runtime/browser/ui/color_chooser_mac.cc',
199         'runtime/browser/ui/native_app_window.cc',
200         'runtime/browser/ui/native_app_window.h',
201         'runtime/browser/ui/native_app_window_android.cc',
202         'runtime/browser/ui/native_app_window_mac.h',
203         'runtime/browser/ui/native_app_window_mac.mm',
204         'runtime/browser/ui/native_app_window_tizen.cc',
205         'runtime/browser/ui/native_app_window_tizen.h',
206         'runtime/browser/ui/native_app_window_views.cc',
207         'runtime/browser/ui/native_app_window_views.h',
208         'runtime/browser/ui/splash_screen_tizen.cc',
209         'runtime/browser/ui/splash_screen_tizen.h',
210         'runtime/browser/ui/taskbar_util.h',
211         'runtime/browser/ui/taskbar_util_win.cc',
212         'runtime/browser/ui/top_view_layout_views.cc',
213         'runtime/browser/ui/top_view_layout_views.h',
214         'runtime/browser/ui/xwalk_views_delegate.cc',
215         'runtime/browser/ui/xwalk_views_delegate.h',
216         'runtime/browser/xwalk_app_extension_bridge.cc',
217         'runtime/browser/xwalk_app_extension_bridge.h',
218         'runtime/browser/xwalk_application_mac.h',
219         'runtime/browser/xwalk_application_mac.mm',
220         'runtime/browser/xwalk_browser_main_parts.cc',
221         'runtime/browser/xwalk_browser_main_parts.h',
222         'runtime/browser/xwalk_browser_main_parts_android.cc',
223         'runtime/browser/xwalk_browser_main_parts_android.h',
224         'runtime/browser/xwalk_browser_main_parts_mac.h',
225         'runtime/browser/xwalk_browser_main_parts_mac.mm',
226         'runtime/browser/xwalk_browser_main_parts_tizen.cc',
227         'runtime/browser/xwalk_browser_main_parts_tizen.h',
228         'runtime/browser/xwalk_component.h',
229         'runtime/browser/xwalk_content_browser_client.cc',
230         'runtime/browser/xwalk_content_browser_client.h',
231         'runtime/browser/xwalk_render_message_filter.cc',
232         'runtime/browser/xwalk_render_message_filter.h',
233         'runtime/browser/xwalk_runner.cc',
234         'runtime/browser/xwalk_runner.h',
235         'runtime/browser/xwalk_runner_android.cc',
236         'runtime/browser/xwalk_runner_android.h',
237         'runtime/browser/xwalk_runner_tizen.cc',
238         'runtime/browser/xwalk_runner_tizen.h',
239         'runtime/common/android/xwalk_globals_android.cc',
240         'runtime/common/android/xwalk_globals_android.h',
241         'runtime/common/android/xwalk_hit_test_data.cc',
242         'runtime/common/android/xwalk_hit_test_data.h',
243         'runtime/common/android/xwalk_message_generator.cc',
244         'runtime/common/android/xwalk_message_generator.h',
245         'runtime/common/android/xwalk_render_view_messages.cc',
246         'runtime/common/android/xwalk_render_view_messages.h',
247         'runtime/common/paths_mac.h',
248         'runtime/common/paths_mac.mm',
249         'runtime/common/xwalk_common_messages.cc',
250         'runtime/common/xwalk_common_messages.h',
251         'runtime/common/xwalk_common_message_generator.cc',
252         'runtime/common/xwalk_common_message_generator.h',
253         'runtime/common/xwalk_content_client.cc',
254         'runtime/common/xwalk_content_client.h',
255         'runtime/common/xwalk_localized_error.cc',
256         'runtime/common/xwalk_localized_error.h',
257         'runtime/common/xwalk_paths.cc',
258         'runtime/common/xwalk_paths.h',
259         'runtime/common/xwalk_runtime_features.cc',
260         'runtime/common/xwalk_runtime_features.h',
261         'runtime/common/xwalk_switches.cc',
262         'runtime/common/xwalk_switches.h',
263         'runtime/common/xwalk_system_locale.cc',
264         'runtime/common/xwalk_system_locale.h',
265         'runtime/renderer/android/xwalk_render_process_observer.cc',
266         'runtime/renderer/android/xwalk_render_process_observer.h',
267         'runtime/renderer/android/xwalk_permission_client.cc',
268         'runtime/renderer/android/xwalk_permission_client.h',
269         'runtime/renderer/android/xwalk_render_view_ext.cc',
270         'runtime/renderer/android/xwalk_render_view_ext.h',
271         'runtime/renderer/isolated_file_system.cc',
272         'runtime/renderer/isolated_file_system.h',
273         'runtime/renderer/pepper/pepper_helper.cc',
274         'runtime/renderer/pepper/pepper_helper.h',
275         'runtime/renderer/pepper/pepper_uma_host.cc',
276         'runtime/renderer/pepper/pepper_uma_host.h',
277         'runtime/renderer/pepper/xwalk_renderer_pepper_host_factory.cc',
278         'runtime/renderer/pepper/xwalk_renderer_pepper_host_factory.h',
279         'runtime/renderer/tizen/xwalk_content_renderer_client_tizen.cc',
280         'runtime/renderer/tizen/xwalk_content_renderer_client_tizen.h',
281         'runtime/renderer/tizen/xwalk_render_view_ext_tizen.cc',
282         'runtime/renderer/tizen/xwalk_render_view_ext_tizen.h',
283         'runtime/renderer/xwalk_content_renderer_client.cc',
284         'runtime/renderer/xwalk_content_renderer_client.h',
285         'runtime/renderer/xwalk_render_process_observer_generic.cc',
286         'runtime/renderer/xwalk_render_process_observer_generic.h',
287       ],
288       'includes': [
289         'xwalk_jsapi.gypi',
290       ],
291       'msvs_settings': {
292         'VCLinkerTool': {
293           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
294         },
295       },
296       'conditions': [
297         ['tizen==1', {
298           'dependencies': [
299             '../content/app/resources/content_resources.gyp:content_resources',
300             'build/system.gyp:tizen_geolocation',
301             'sysapps/sysapps_resources.gyp:xwalk_sysapps_resources',
302             'tizen/xwalk_tizen.gypi:xwalk_tizen_lib',
303             '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
304             '../components/components.gyp:web_modal',
305             '../components/components.gyp:renderer_context_menu',
306           ],
307           'cflags': [
308             '<!@(pkg-config --cflags libtzplatform-config)',
309           ],
310           'link_settings': {
311             'libraries': [
312               '<!@(pkg-config --libs libtzplatform-config)',
313             ],
314           },
315           'sources': [
316             'experimental/native_file_system/virtual_root_provider_tizen.cc',
317             'runtime/browser/tizen/tizen_locale_listener.cc',
318             'runtime/browser/tizen/tizen_locale_listener.h',
319             'runtime/browser/tizen/xwalk_web_contents_view_delegate.cc',
320             'runtime/browser/tizen/xwalk_web_contents_view_delegate.h',
321             'runtime/browser/tizen/render_view_context_menu_impl.cc',
322             'runtime/browser/tizen/render_view_context_menu_impl.h',
323           ],
324           'sources!':[
325             'runtime/browser/runtime_platform_util_linux.cc',
326             'runtime/browser/android/xwalk_web_contents_view_delegate.cc',
327             'runtime/browser/android/xwalk_web_contents_view_delegate.h',
328           ],
329         }],
330         ['OS=="android"',{
331           'dependencies':[
332             'xwalk_core_jar_jni',
333             'xwalk_core_native_jni',
334           ],
335           'sources': [
336             'experimental/native_file_system/virtual_root_provider_android.cc',
337           ],
338           'sources!':[
339             'runtime/renderer/xwalk_render_process_observer_generic.cc',
340             'runtime/renderer/xwalk_render_process_observer_generic.h',
341           ],
342         }],
343         ['OS=="win" and win_use_allocator_shim==1', {
344           'dependencies': [
345             '../base/allocator/allocator.gyp:allocator',
346           ],
347         }],
348         ['OS=="win"', {
349           'resource_include_dirs': [
350             '<(SHARED_INTERMEDIATE_DIR)/webkit',
351           ],
352           'configurations': {
353             'Debug_Base': {
354               'msvs_settings': {
355                 'VCLinkerTool': {
356                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
357                 },
358               },
359             },
360           },
361           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
362           'msvs_disabled_warnings': [ 4267, ],
363         }],  # OS=="win"
364         ['OS=="linux"', {
365           'dependencies': [
366             '../build/linux/system.gyp:fontconfig',
367             '../build/linux/system.gyp:dbus',
368           ],
369           'sources': [
370             'experimental/native_file_system/virtual_root_provider_linux.cc',
371           ]
372         }],  # OS=="linux"
373         ['os_posix==1 and OS != "mac" and use_allocator=="tcmalloc"', {
374           'dependencies': [
375             # This is needed by content/app/content_main_runner.cc
376             '../base/allocator/allocator.gyp:allocator',
377           ],
378         }],  # os_posix==1 and OS != "mac" and use_allocator=="tcmalloc"
379         ['toolkit_views==1', {
380           'dependencies': [
381             '../ui/events/events.gyp:events',
382             '../ui/strings/ui_strings.gyp:ui_strings',
383             '../ui/views/controls/webview/webview.gyp:webview',
384             '../ui/views/views.gyp:views',
385             '../ui/resources/ui_resources.gyp:ui_resources',
386           ],
387         }],  # toolkit_views==1
388         ['use_aura==1', {
389           'dependencies': [
390             '../ui/aura/aura.gyp:aura',
391           ],
392         }, {  # use_aura==0
393           'sources/': [
394             ['exclude', '_aura\\.cc$'],
395           ],
396         }],
397         ['disable_nacl==0', {
398             'conditions': [
399                 ['OS=="linux"', {
400                   'sources': [
401                     'runtime/browser/nacl_host/nacl_browser_delegate_impl.cc',
402                     'runtime/browser/nacl_host/nacl_browser_delegate_impl.h',
403                   ],
404                   'dependencies': [
405                     '../components/nacl.gyp:nacl',
406                     '../components/nacl.gyp:nacl_browser',
407                     '../components/nacl.gyp:nacl_common',
408                     '../components/nacl.gyp:nacl_renderer',
409                     '../components/nacl.gyp:nacl_helper',
410                     '../components/nacl.gyp:nacl_linux',
411                     '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
412                     '../ppapi/native_client/src/trusted/plugin/plugin.gyp:nacl_trusted_plugin',
413                   ],
414                 }],
415             ],
416         }],
417         ['enable_plugins==1', {
418           'dependencies': [
419             '../ppapi/ppapi_internal.gyp:ppapi_host',
420             '../ppapi/ppapi_internal.gyp:ppapi_proxy',
421             '../ppapi/ppapi_internal.gyp:ppapi_ipc',
422             '../ppapi/ppapi_internal.gyp:ppapi_shared',
423           ],
424         }, {  # enable_plugins==0
425           'sources/': [
426             ['exclude', '^runtime/browser/renderer_host/pepper/'],
427             ['exclude', '^runtime/renderer/pepper/'],
428           ],
429         }],
430       ],
431     },
432     {
433       'target_name': 'generate_upstream_blink_version',
434       'type': 'none',
435       'actions': [
436         {
437           'action_name': 'generate_blink_upstream_version',
438           'inputs': [
439             '<(script)',
440             '<(upstream)',
441             '<(template)',
442           ],
443           'outputs': [
444             '<(SHARED_INTERMEDIATE_DIR)/blink_upstream_version.h',
445           ],
446           'action': ['python',
447                      '<(script)',
448                      '-f', '<(upstream)',
449                      '<(template)',
450                      '<@(_outputs)',
451           ],
452           'variables': {
453             'script': '<(DEPTH)/build/util/version.py',
454             'upstream': '<(DEPTH)/xwalk/build/UPSTREAM.blink',
455             'template': 'runtime/browser/blink_upstream_version.h.in',
456           },
457         },
458       ],
459     },
460     {
461       'target_name': 'xwalk_resources',
462       'type': 'none',
463       'dependencies': [
464         'generate_xwalk_resources',
465       ],
466       'variables': {
467         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/xwalk',
468       },
469       'includes': [ '../build/grit_target.gypi' ],
470       'copies': [
471         {
472           'destination': '<(PRODUCT_DIR)',
473           'files': [
474             '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_resources.pak'
475           ],
476         },
477       ],
478     },
479     {
480       'target_name': 'generate_xwalk_resources',
481       'type': 'none',
482       'variables': {
483         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/xwalk',
484       },
485       'actions': [
486         {
487           'action_name': 'xwalk_resources',
488           'variables': {
489             'grit_resource_ids': 'resources/resource_ids',
490             'grit_grd_file': 'runtime/resources/xwalk_resources.grd',
491           },
492           'includes': [ '../build/grit_action.gypi' ],
493         },
494       ],
495     },
496     {
497       # Build a minimal set of resources so Blink in XWalk has
498       # access to necessary resources.
499       'target_name': 'xwalk_pak',
500       'type': 'none',
501       'dependencies': [
502         '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
503         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
504         '<(DEPTH)/content/app/resources/content_resources.gyp:content_resources',
505         'xwalk_resources',
506       ],
507       'conditions': [
508         [ 'OS!="android"', {
509           'dependencies': [
510             '<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
511           ],
512         }],
513       ],
514       'variables': {
515         'repack_path': '../tools/grit/grit/format/repack.py',
516       },
517       'actions': [
518         {
519           'action_name': 'repack_xwalk_resources',
520           'variables': {
521             'pak_inputs': [
522               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_resources.pak',
523               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_application_resources.pak',
524               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_extensions_resources.pak',
525               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_sysapps_resources.pak',
526               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
527               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
528               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
529               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
530               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
531               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
532               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
533               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak',
534             ],
535           },
536           'conditions': [
537             [ 'OS!="android"', {
538               'variables': {
539                 'pak_inputs+': [
540                   '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
541                 ],
542               },
543             }],
544             [ 'tizen_mobile == 1', {
545               'variables': {
546                 'pak_inputs+': [
547                   '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_sysapps_resources.pak',
548                 ],
549               },
550             }],
551             [ 'tizen==1', {
552               'variables': {
553                 'pak_inputs+': [
554                   # Add WebUI resources for Tizen.
555                   '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
556                   '<(SHARED_INTERMEDIATE_DIR)/ui/resources/webui_resources.pak',
557                 ],
558               },
559             }],
560           ],
561           'inputs': [
562             '<(repack_path)',
563             '<@(pak_inputs)',
564           ],
565           'action': ['python', '<(repack_path)', '<@(_outputs)',
566                      '<@(pak_inputs)'],
567           'outputs':[
568             '<(PRODUCT_DIR)/xwalk.pak',
569           ],
570         },
571       ],
572     },
573     {
574       'target_name': 'xwalk',
575       'type': 'executable',
576       'mac_bundle': 1,
577       'defines!': ['CONTENT_IMPLEMENTATION'],
578       'dependencies': [
579         'xwalk_runtime',
580         'xwalk_pak',
581       ],
582       'include_dirs': [
583         '..',
584       ],
585       'sources': [
586         'runtime/app/xwalk_main.cc',
587       ],
588       'mac_bundle_resources': [
589         'runtime/app/app.icns',
590         'runtime/app/app-Info.plist',
591       ],
592       # TODO(mark): Come up with a fancier way to do this.  It should only
593       # be necessary to list app-Info.plist once, not the three times it is
594       # listed here.
595       'mac_bundle_resources!': [
596         'runtime/app/app-Info.plist',
597       ],
598       'xcode_settings': {
599         'INFOPLIST_FILE': 'runtime/app/app-Info.plist',
600       },
601       'msvs_settings': {
602         'VCLinkerTool': {
603           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
604         },
605       },
606       'conditions': [
607         ['OS=="win" and win_use_allocator_shim==1', {
608           'dependencies': [
609             '../base/allocator/allocator.gyp:allocator',
610           ],
611         }],
612         ['OS=="win"', {
613           'sources': [
614             '../content/app/startup_helper_win.cc', # Needed by InitializedSandbox
615             'runtime/resources/xwalk.rc',
616           ],
617           'configurations': {
618             'Debug_Base': {
619               'msvs_settings': {
620                 'VCLinkerTool': {
621                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
622                 },
623               },
624             },
625           },
626         }],  # OS=="win"
627         ['OS == "win"', {
628           'dependencies': [
629             '../sandbox/sandbox.gyp:sandbox',
630           ],
631         }],  # OS=="win"
632         ['OS=="mac"', {
633           'product_name': '<(xwalk_product_name)',
634           'dependencies!': [
635             'xwalk_runtime',
636           ],
637           'dependencies': [
638             'xwalk_framework',
639             'xwalk_helper_app',
640           ],
641           'copies': [
642             {
643               'destination': '<(PRODUCT_DIR)/<(xwalk_product_name).app/Contents/Frameworks',
644               'files': [
645                 '<(PRODUCT_DIR)/<(xwalk_product_name) Helper.app',
646               ],
647             },
648           ],
649           'postbuilds': [
650             {
651               'postbuild_name': 'Copy <(xwalk_product_name) Framework.framework',
652               'action': [
653                 '../build/mac/copy_framework_unversioned.sh',
654                 '${BUILT_PRODUCTS_DIR}/<(xwalk_product_name) Framework.framework',
655                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
656               ],
657             },
658             {
659               'postbuild_name': 'Fix Framework Link',
660               'action': [
661                 'install_name_tool',
662                 '-change',
663                 '/Library/Frameworks/<(xwalk_product_name) Framework.framework/Versions/A/<(xwalk_product_name) Framework',
664                 '@executable_path/../Frameworks/<(xwalk_product_name) Framework.framework/<(xwalk_product_name) Framework',
665                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
666               ],
667             },
668             {
669               # Modify the Info.plist as needed.
670               'postbuild_name': 'Tweak Info.plist',
671               'action': ['../build/mac/tweak_info_plist.py',
672                          '--scm=1',
673                          '--version=<(xwalk_version)'],
674             },
675             {
676               # This postbuid step is responsible for creating the following
677               # helpers:
678               #
679               # XWalk Helper EH.app and XWalk Helper NP.app are
680               # created from XWalk Helper.app.
681               #
682               # The EH helper is marked for an executable heap. The NP helper
683               # is marked for no PIE (ASLR).
684               'postbuild_name': 'Make More Helpers',
685               'action': [
686                 '../build/mac/make_more_helpers.sh',
687                 'Frameworks',
688                 '<(xwalk_product_name)',
689               ],
690             },
691             {
692               # Make sure there isn't any Objective-C in the xwalk's
693               # executable.
694               'postbuild_name': 'Verify No Objective-C',
695               'action': [
696                 '../build/mac/verify_no_objc.sh',
697               ],
698             },
699           ],
700         }],  # OS=="mac"
701       ],
702     },
703     {
704       'target_name': 'xwalk_builder',
705       'type': 'none',
706       'conditions': [
707         ['OS!="android"', {
708           'dependencies': [
709             'xwalk',
710             'xwalk_all_tests',
711           ],
712         },
713         {
714           'dependencies': [
715             # For internal testing.
716             'xwalk_core_internal_shell_apk',
717             'xwalk_core_internal_test_apk',
718             'xwalk_core_shell_apk',
719             'xwalk_core_test_apk',
720             'xwalk_runtime_client_embedded_shell_apk',
721             'xwalk_runtime_client_embedded_test_apk',
722             'xwalk_runtime_client_shell_apk',
723             'xwalk_runtime_client_test_apk',
724
725             # For external testing.
726             'pack_xwalk_core_library',
727             'xwalk_core_library_documentation',
728             'xwalk_runtime_lib_apk',
729             'xwalk_app_hello_world_apk',
730             'xwalk_app_template',
731             'xwalk_core_sample_apk',
732             'xwalk_core_library_aar',
733             'xwalk_packaging_tool_test',
734           ],
735         }],
736       ],
737     },
738   ], # targets
739   'conditions': [
740     ['OS=="linux"', {
741       'includes': [ 'extensions/xesh/xesh.gypi' ],
742     }],
743     ['OS=="mac"', {
744       'targets': [
745         {
746           'target_name': 'xwalk_framework',
747           'type': 'shared_library',
748           'product_name': '<(xwalk_product_name) Framework',
749           'mac_bundle': 1,
750           'mac_bundle_resources': [
751             'runtime/app/English.lproj/MainMenu.xib',
752             '<(PRODUCT_DIR)/xwalk.pak'
753           ],
754           'dependencies': [
755             'xwalk_runtime',
756           ],
757           'include_dirs': [
758             '..',
759           ],
760           'sources': [
761             'runtime/app/xwalk_content_main.cc',
762             'runtime/app/xwalk_content_main.h',
763           ],
764           'copies': [
765             {
766               # Copy FFmpeg binaries for audio/video support.
767               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
768               'files': [
769                 '<(PRODUCT_DIR)/ffmpegsumo.so',
770               ],
771             },
772           ],
773           'conditions': [
774             ['enable_webrtc==1', {
775               'variables': {
776                 'libpeer_target_type%': 'static_library',
777               },
778               'conditions': [
779                 ['libpeer_target_type!="static_library"', {
780                   'copies': [{
781                    'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
782                    'files': [
783                       '<(PRODUCT_DIR)/libpeerconnection.so',
784                     ],
785                   }],
786                 }],
787               ],
788             }],
789             ['icu_use_data_file_flag==1', {
790               'mac_bundle_resources': [
791                 '<(PRODUCT_DIR)/icudtl.dat',
792               ],
793             }],
794           ],
795         },  # target xwalk_framework
796         {
797           'target_name': 'xwalk_helper_app',
798           'type': 'executable',
799           'variables': { 'enable_wexit_time_destructors': 1, },
800           'product_name': '<(xwalk_product_name) Helper',
801           'mac_bundle': 1,
802           'dependencies': [
803             'xwalk_framework',
804           ],
805           'sources': [
806             'runtime/app/xwalk_main.cc',
807             'runtime/app/helper-Info.plist',
808           ],
809           # TODO(mark): Come up with a fancier way to do this.  It should only
810           # be necessary to list helper-Info.plist once, not the three times it
811           # is listed here.
812           'mac_bundle_resources!': [
813             'runtime/app/helper-Info.plist',
814           ],
815           # TODO(mark): For now, don't put any resources into this app.  Its
816           # resources directory will be a symbolic link to the browser app's
817           # resources directory.
818           'mac_bundle_resources/': [
819             ['exclude', '.*'],
820           ],
821           'xcode_settings': {
822             'INFOPLIST_FILE': 'runtime/app/helper-Info.plist',
823           },
824           'postbuilds': [
825             {
826               # The framework defines its load-time path
827               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
828               # (chrome).  A different relative path needs to be used in
829               # xwalk_helper_app.
830               'postbuild_name': 'Fix Framework Link',
831               'action': [
832                 'install_name_tool',
833                 '-change',
834                 '/Library/Frameworks/<(xwalk_product_name) Framework.framework/Versions/A/<(xwalk_product_name) Framework',
835                 '@executable_path/../../../../Frameworks/<(xwalk_product_name) Framework.framework/<(xwalk_product_name) Framework',
836                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
837               ],
838             },
839             {
840               # Modify the Info.plist as needed.  The script explains why this
841               # is needed.  This is also done in the chrome and chrome_dll
842               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
843               # are used because Breakpad, Keystone, and SCM keys are
844               # never placed into the helper.
845               'postbuild_name': 'Tweak Info.plist',
846               'action': ['../build/mac/tweak_info_plist.py',
847                          '--breakpad=0',
848                          '--keystone=0',
849                          '--scm=0',
850                          '--version=<(xwalk_version)'],
851             },
852             {
853               # Make sure there isn't any Objective-C in the helper app's
854               # executable.
855               'postbuild_name': 'Verify No Objective-C',
856               'action': [
857                 '../build/mac/verify_no_objc.sh',
858               ],
859             },
860           ],
861           'conditions': [
862             ['component=="shared_library"', {
863               'xcode_settings': {
864                 'LD_RUNPATH_SEARCH_PATHS': [
865                   # Get back from XWalk.app/Contents/Frameworks/
866                   #                                 Helper.app/Contents/MacOS
867                   '@loader_path/../../../../../..',
868                 ],
869               },
870             }],
871           ],
872         },  # target xwalk_helper_app
873       ],
874     }],  # OS=="mac"
875     ['OS=="android"', {
876       'variables': {
877         'variables': {
878           'conditions': [
879             ['android_app_abi=="x86"', {
880               'version_code_shift%': 1,
881             }],
882             ['android_app_abi=="armeabi-v7a"', {
883               'version_code_shift%': 2,
884             }],
885             ['android_app_abi=="armeabi"', {
886               'version_code_shift%': 3,
887             }],
888           ], # conditions
889         },
890         'version_code_shift%': '<(version_code_shift)',
891         'xwalk_version_code': '<!(python tools/build/android/generate_version_code.py -f VERSION -s <(version_code_shift))',
892       },
893       'includes': [
894         'xwalk_android.gypi',
895         'xwalk_android_tests.gypi',
896         'xwalk_android_app.gypi',
897         'xwalk_core_library_android.gypi',
898       ],
899       'targets': [
900       {
901         'target_name': 'All',
902         'type': 'none',
903         'dependencies': [
904           'xwalk',
905         ],
906       }, # target_name: All
907     ],  # targets
908     }], # OS=="android"
909   ]
910 }