Default to current UI locale when recommended locales are invalid
[chromium-blink-merge.git] / content / content.gyp
blob4da6428265ba3dcfdf59cc9fce593d64d484bd5c
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,  # Use higher warning level.
8     'chromium_enable_vtune_jit_for_v8%': 0,  # enable the vtune support for V8 engine.
9     'directxsdk_exists': '<!pymod_do_main(dir_exists ../third_party/directxsdk)',
10   },
11   'target_defaults': {
12     'defines': ['CONTENT_IMPLEMENTATION'],
13     'conditions': [
14       # TODO(jschuh): Remove this after crbug.com/173851 gets fixed.
15       ['OS=="win" and target_arch=="x64"', {
16         'msvs_settings': {
17           'VCCLCompilerTool': {
18             'AdditionalOptions': ['/bigobj'],
19           },
20         },
21       }],
22     ],
23   },
24   'conditions': [
25     ['OS != "ios"', {
26       'includes': [
27         'content_common_mojo_bindings.gypi',
28         '../build/win_precompile.gypi',
29       ],
30     }],
31     ['OS == "win"', {
32       'targets': [
33         {
34           'target_name': 'content_startup_helper_win',
35           'type': 'static_library',
36           'include_dirs': [
37             '..',
38           ],
39           'dependencies': [
40             '../base/base.gyp:base',
41             '../base/base.gyp:base_i18n',
42             '../sandbox/sandbox.gyp:sandbox',
43           ],
44           'sources': [
45             'app/startup_helper_win.cc',
46             'public/app/startup_helper_win.h',
47           ],
48         }
49       ],
50     }],
51     # In component mode, we build all of content as a single DLL.
52     # However, in the static mode, we need to build content as multiple
53     # targets in order to prevent dependencies from getting introduced
54     # upstream unnecessarily (e.g., content_renderer depends on allocator
55     # and chrome_exe depends on content_common but we don't want
56     # chrome_exe to have to depend on allocator).
57     ['component=="static_library"', {
58       'target_defines': [
59         'COMPILE_CONTENT_STATICALLY',
60       ],
61       'targets': [
62         {
63           # GN version: //content
64           'target_name': 'content',
65           'type': 'none',
66           'dependencies': [
67             'content_browser',
68             'content_common',
69           ],
70           'export_dependent_settings': [
71             'content_common',
72           ],
73           'conditions': [
74             ['OS != "ios"', {
75               'dependencies': [
76                 'content_child',
77                 'content_gpu',
78                 'content_plugin',
79                 'content_ppapi_plugin',
80                 'content_renderer',
81                 'content_utility',
82               ],
83             }],
84           ],
85         },
86         {
87           # GN version: //content/app:browser
88           'target_name': 'content_app_browser',
89           'type': 'static_library',
90           'variables': { 'enable_wexit_time_destructors': 1, },
91           'includes': [
92             'content_app.gypi',
93           ],
94           'dependencies': [
95             'content_common',
96           ],
97           'export_dependent_settings': [
98             'content_common',
99           ],
100           'conditions': [
101             ['chrome_multiple_dll', {
102               'defines': [
103                 'CHROME_MULTIPLE_DLL_BROWSER',
104               ],
105             }],
106           ],
107         },
108         {
109           # GN version: //content/app:child
110           'target_name': 'content_app_child',
111           'type': 'static_library',
112           'variables': { 'enable_wexit_time_destructors': 1, },
113           'includes': [
114             'content_app.gypi',
115           ],
116           'dependencies': [
117             'content_common',
118           ],
119           'export_dependent_settings': [
120             'content_common',
121           ],
122           'conditions': [
123             ['chrome_multiple_dll', {
124               'defines': [
125                 'CHROME_MULTIPLE_DLL_CHILD',
126               ],
127             }],
128           ],
129         },
130         {
131           # GN version: //content/app:both
132           'target_name': 'content_app_both',
133           'type': 'static_library',
134           'variables': { 'enable_wexit_time_destructors': 1, },
135           'includes': [
136             'content_app.gypi',
137           ],
138           'dependencies': [
139             'content_common',
140           ],
141           'export_dependent_settings': [
142             'content_common',
143           ],
144         },
145         {
146           # GN version: //content/browser and //content/public/browser
147           'target_name': 'content_browser',
148           'type': 'static_library',
149           'variables': { 'enable_wexit_time_destructors': 1, },
150           'includes': [
151             'content_browser.gypi',
152           ],
153           'dependencies': [
154             'content_common',
155             'content_resources.gyp:content_resources',
156           ],
157           'export_dependent_settings': [
158             'content_common',
159           ],
160           'conditions': [
161             ['java_bridge==1', {
162               'dependencies': [
163                 'content_child',
164               ]
165             }],
166             ['OS=="android"', {
167               'dependencies': [
168                 'content_gpu',
169                 'content_utility',
170               ],
171             }],
172           ],
173         },
174         {
175           # GN version: //content/common and //content/public/common
176           'target_name': 'content_common',
177           'type': 'static_library',
178           'variables': { 'enable_wexit_time_destructors': 1, },
179           'includes': [
180             'content_common.gypi',
181           ],
182           'conditions': [
183             ['OS != "ios"', {
184               'dependencies': [
185                 'content_resources.gyp:content_resources',
186               ],
187             }],
188           ],
189           # Disable c4267 warnings until we fix size_t to int truncations.
190           'msvs_disabled_warnings': [ 4267, ],
191         },
192       ],
193       'conditions': [
194         ['OS != "ios"', {
195           'targets': [
196             {
197               # GN version: //content/child and //content/public/child
198               'target_name': 'content_child',
199               'type': 'static_library',
200               'variables': { 'enable_wexit_time_destructors': 1, },
201               'includes': [
202                 'content_child.gypi',
203               ],
204               'dependencies': [
205                 'content_resources.gyp:content_resources',
206               ],
207               # Disable c4267 warnings until we fix size_t to int truncations.
208               'msvs_disabled_warnings': [ 4267, ],
209             },
210             {
211               # GN version: //content/gpu
212               'target_name': 'content_gpu',
213               'type': 'static_library',
214               'variables': { 'enable_wexit_time_destructors': 1, },
215               'includes': [
216                 'content_gpu.gypi',
217               ],
218               'dependencies': [
219                 'content_child',
220                 'content_common',
221               ],
222             },
223             {
224               # GN version: //content/plugin and //content/public/plugin
225               'target_name': 'content_plugin',
226               'type': 'static_library',
227               'variables': { 'enable_wexit_time_destructors': 1, },
228               'includes': [
229                 'content_plugin.gypi',
230               ],
231               'dependencies': [
232                 'content_child',
233                 'content_common',
234               ],
235             },
236             {
237               # GN version: //content/ppapi_plugin
238               'target_name': 'content_ppapi_plugin',
239               'type': 'static_library',
240               'variables': { 'enable_wexit_time_destructors': 1, },
241               'includes': [
242                 'content_ppapi_plugin.gypi',
243               ],
244               # Disable c4267 warnings until we fix size_t to int truncations.
245               'msvs_disabled_warnings': [ 4267, ],
246             },
247             {
248               # GN version: //content/renderer and //content/public/renderer
249               'target_name': 'content_renderer',
250               'type': 'static_library',
251               'variables': { 'enable_wexit_time_destructors': 1, },
252               'includes': [
253                 'content_renderer.gypi',
254               ],
255               'dependencies': [
256                 'content_child',
257                 'content_common',
258                 'content_resources.gyp:content_resources',
259               ],
260               'conditions': [
261                 ['chromium_enable_vtune_jit_for_v8==1', {
262                   'dependencies': [
263                     '../v8/src/third_party/vtune/v8vtune.gyp:v8_vtune',
264                   ],
265                 }],
266               ],
267             },
268             {
269               # GN version: //content/utility and //content/public/utility
270               'target_name': 'content_utility',
271               'type': 'static_library',
272               'variables': { 'enable_wexit_time_destructors': 1, },
273               'includes': [
274                 'content_utility.gypi',
275               ],
276               'dependencies': [
277                 'content_child',
278                 'content_common',
279               ],
280             },
281           ],
282         }],
283       ],
284     },
285     {  # component != static_library
286       'targets': [
287         {
288           # GN version: //content
289           'target_name': 'content',
290           'type': 'shared_library',
291           'variables': { 'enable_wexit_time_destructors': 1, },
292           'dependencies': [
293            'content_resources.gyp:content_resources',
294           ],
295           'conditions': [
296             ['chromium_enable_vtune_jit_for_v8==1', {
297               'dependencies': [
298                 '../v8/src/third_party/vtune/v8vtune.gyp:v8_vtune',
299               ],
300             }],
301           ],
302           'includes': [
303             'content_app.gypi',
304             'content_browser.gypi',
305             'content_child.gypi',
306             'content_common.gypi',
307             'content_gpu.gypi',
308             'content_plugin.gypi',
309             'content_ppapi_plugin.gypi',
310             'content_renderer.gypi',
311             'content_utility.gypi',
312           ],
313           'msvs_settings': {
314             'VCLinkerTool': {
315               'conditions': [
316                 ['incremental_chrome_dll==1', {
317                   'UseLibraryDependencyInputs': "true",
318                 }],
319               ],
320             },
321           },
322         },
323         {
324           # GN version: //content/app:browser
325           'target_name': 'content_app_browser',
326           'type': 'none',
327           'dependencies': ['content', 'content_browser'],
328         },
329         {
330           # GN version: //content/app:child
331           'target_name': 'content_app_child',
332           'type': 'none',
333           'dependencies': ['content', 'content_child'],
334         },
335         {
336           # GN version: //content/app:both
337           'target_name': 'content_app_both',
338           'type': 'none',
339           'dependencies': ['content'],
340           'export_dependent_settings': ['content'],
341         },
342         {
343           # GN version: //content/browser and //content/public/browser
344           'target_name': 'content_browser',
345           'type': 'none',
346           'dependencies': ['content'],
347           'export_dependent_settings': ['content'],
348         },
349         {
350           # GN version: //content/common and //content/public/common
351           'target_name': 'content_common',
352           'type': 'none',
353           'dependencies': ['content', 'content_resources.gyp:content_resources'],
354           # Disable c4267 warnings until we fix size_t to int truncations.
355           'msvs_disabled_warnings': [ 4267, ],
356           'export_dependent_settings': ['content'],
357         },
358         {
359           # GN Version: //content/child
360           'target_name': 'content_child',
361           'type': 'none',
362           'dependencies': ['content'],
363         },
364         {
365           # GN version: //content/gpu
366           'target_name': 'content_gpu',
367           'type': 'none',
368           'dependencies': ['content'],
369         },
370         {
371           # GN version: //content/plugin
372           'target_name': 'content_plugin',
373           'type': 'none',
374           'dependencies': ['content'],
375         },
376         {
377           # GN version: //content/ppapi_plugin
378           'target_name': 'content_ppapi_plugin',
379           'type': 'none',
380           'dependencies': ['content'],
381           # Disable c4267 warnings until we fix size_t to int truncations.
382           'msvs_disabled_warnings': [ 4267, ],
383         },
384         {
385           # GN version: //content/renderer and //content/public/renderer
386           'target_name': 'content_renderer',
387           'type': 'none',
388           'dependencies': ['content'],
389         },
390         {
391           # GN version: //content/utility
392           'target_name': 'content_utility',
393           'type': 'none',
394           'dependencies': ['content'],
395           'export_dependent_settings': ['content'],
396         },
397       ],
398     }],
399     ['OS == "android"', {
400       'targets': [
401         {
402           'target_name': 'common_aidl',
403           'type': 'none',
404           'variables': {
405             'aidl_interface_file': 'public/android/java/src/org/chromium/content/common/common.aidl',
406             'aidl_import_include': 'public/android/java/src',
407           },
408           'sources': [
409             'public/android/java/src/org/chromium/content/common/IChildProcessCallback.aidl',
410             'public/android/java/src/org/chromium/content/common/IChildProcessService.aidl',
411           ],
412           'includes': [ '../build/java_aidl.gypi' ],
413         },
414         {
415           'target_name': 'content_java',
416           'type': 'none',
417           'dependencies': [
418             '../base/base.gyp:base',
419             '../media/media.gyp:media_java',
420             '../net/net.gyp:net',
421             '../ui/android/ui_android.gyp:ui_java',
422             'common_aidl',
423             'content_common',
424             'content_strings_grd',
425             'content_gamepad_mapping',
426             'gesture_event_type_java',
427             'page_transition_types_java',
428             'popup_item_type_java',
429             'result_codes_java',
430             'selection_event_type_java',
431             'speech_recognition_error_java',
432             'top_controls_state_java',
433             'screen_orientation_values_java',
434           ],
435           'variables': {
436             'java_in_dir': '../content/public/android/java',
437             'has_java_resources': 1,
438             'R_package': 'org.chromium.content',
439             'R_package_relpath': 'org/chromium/content',
440           },
441           'conditions': [
442             ['android_webview_build == 0', {
443               'dependencies': [
444                 '../third_party/eyesfree/eyesfree.gyp:eyesfree_java',
445                 '../third_party/guava/guava.gyp:guava_javalib',
446               ],
447             }],
448           ],
449           'includes': [ '../build/java.gypi' ],
450         },
451         {
452           'target_name': 'content_strings_grd',
453           # The android_webview/Android.mk file depends on this target directly.
454           'android_unmangled_name': 1,
455           'type': 'none',
456           'variables': {
457             'grd_file': '../content/public/android/java/strings/android_content_strings.grd',
458           },
459           'includes': [
460             '../build/java_strings_grd.gypi',
461           ],
462         },
463         {
464           'target_name': 'gesture_event_type_java',
465           'type': 'none',
466           'sources': [
467             'public/android/java/src/org/chromium/content/browser/GestureEventType.template',
468           ],
469           'variables': {
470             'package_name': 'org/chromium/content/browser',
471             'template_deps': ['browser/android/gesture_event_type_list.h'],
472           },
473           'includes': [ '../build/android/java_cpp_template.gypi' ],
474         },
475         {
476           'target_name': 'page_transition_types_java',
477           'type': 'none',
478           'sources': [
479             'public/android/java/src/org/chromium/content/browser/PageTransitionTypes.template',
480           ],
481           'variables': {
482             'package_name': 'org/chromium/content/browser',
483             'template_deps': ['public/common/page_transition_types_list.h'],
484           },
485           'includes': [ '../build/android/java_cpp_template.gypi' ],
486         },
487         {
488           'target_name': 'popup_item_type_java',
489           'type': 'none',
490           'sources': [
491             'public/android/java/src/org/chromium/content/browser/input/PopupItemType.template',
492           ],
493           'variables': {
494             'package_name': 'org/chromium/content/browser/input',
495             'template_deps': ['browser/android/popup_item_type_list.h'],
496           },
497           'includes': [ '../build/android/java_cpp_template.gypi' ],
498         },
499         {
500           'target_name': 'result_codes_java',
501           'type': 'none',
502           'sources': [
503             'public/android/java/src/org/chromium/content/common/ResultCodes.template',
504           ],
505           'variables': {
506             'package_name': 'org/chromium/content/common',
507             'template_deps': ['public/common/result_codes_list.h'],
508           },
509           'includes': [ '../build/android/java_cpp_template.gypi' ],
510         },
511         {
512           'target_name': 'selection_event_type_java',
513           'type': 'none',
514           'sources': [
515             'public/android/java/src/org/chromium/content/browser/input/SelectionEventType.template',
516           ],
517           'variables': {
518             'package_name': 'org/chromium/content/browser/input',
519             'template_deps': ['browser/renderer_host/input/selection_event_type_list.h'],
520           },
521           'includes': [ '../build/android/java_cpp_template.gypi' ],
522         },
523         {
524           'target_name': 'speech_recognition_error_java',
525           'type': 'none',
526           'sources': [
527             'public/android/java/src/org/chromium/content/browser/SpeechRecognitionError.template',
528           ],
529           'variables': {
530             'package_name': 'org/chromium/content/browser',
531             'template_deps': ['public/common/speech_recognition_error_list.h'],
532           },
533           'includes': [ '../build/android/java_cpp_template.gypi' ],
534         },
535         {
536           'target_name': 'top_controls_state_java',
537           'type': 'none',
538           'sources': [
539             'public/android/java/src/org/chromium/content/common/TopControlsState.template',
540           ],
541           'variables': {
542             'package_name': 'org/chromium/content/common',
543             'template_deps': ['public/common/top_controls_state_list.h'],
544           },
545           'includes': [ '../build/android/java_cpp_template.gypi' ],
546         },
547         {
548           'target_name': 'screen_orientation_values_java',
549           'type': 'none',
550           'sources': [
551             'public/android/java/src/org/chromium/content/common/ScreenOrientationValues.template',
552           ],
553           'variables': {
554             'package_name': 'org/chromium/content/common',
555             'template_deps': ['public/common/screen_orientation_values_list.h'],
556           },
557           'includes': [ '../build/android/java_cpp_template.gypi' ],
558         },
559         {
560           'target_name': 'java_set_jni_headers',
561           'type': 'none',
562           'variables': {
563             'jni_gen_package': 'content',
564             'input_java_class': 'java/util/HashSet.class',
565           },
566           'includes': [ '../build/jar_file_jni_generator.gypi' ],
567         },
568         {
569           'target_name': 'motionevent_jni_headers',
570           'type': 'none',
571           'variables': {
572              'jni_gen_package': 'content',
573              'input_java_class': 'android/view/MotionEvent.class',
574            },
575           'includes': [ '../build/jar_file_jni_generator.gypi' ],
576         },
577         {
578           'target_name': 'content_jni_headers',
579           'type': 'none',
580           'dependencies': [
581             'java_set_jni_headers',
582             'motionevent_jni_headers'
583           ],
584           'includes': [ 'content_jni.gypi' ],
585         },
586         {
587           'target_name': 'content_icudata',
588           'type': 'none',
589           'conditions': [
590             ['icu_use_data_file_flag==1', {
591               'copies': [
592                 {
593                   'destination': '<(PRODUCT_DIR)/content_shell/assets',
594                   'files': [
595                     '<(PRODUCT_DIR)/icudtl.dat',
596                   ],
597                 },
598               ],
599             }],
600           ],
601         },
602         {
603           'target_name': 'content_gamepad_mapping',
604           'type': 'none',
605           'sources': [
606             'public/android/java/src/org/chromium/content/browser/input/CanonicalButtonIndex.template',
607             'public/android/java/src/org/chromium/content/browser/input/CanonicalAxisIndex.template',
608           ],
609           'variables': {
610             'package_name': 'org/chromium/content/browser/input',
611             'template_deps': [
612               'browser/gamepad/canonical_axis_index_list.h',
613               'browser/gamepad/canonical_button_index_list.h',
614             ],
615           },
616           'includes': [ '../build/android/java_cpp_template.gypi' ],
617         },
618       ],
619     }],  # OS == "android"
620   ],