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