blob: 87c894d4153f9fb6d7d7113af035bbdeb521d532 [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001# 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.
4
5{
6 'targets': [
7 {
8 'target_name': 'common',
9 'type': 'static_library',
10 'variables': {
11 'chrome_common_target': 1,
12 'enable_wexit_time_destructors': 1,
13 },
14 'include_dirs': [
15 '..',
16 '<(SHARED_INTERMEDIATE_DIR)', # Needed by chrome_content_client.cc.
17 ],
18 'direct_dependent_settings': {
19 'include_dirs': [
20 '..',
21 ],
22 },
23 'dependencies': [
24 # TODO(gregoryd): chrome_resources and chrome_strings could be
25 # shared with the 64-bit target, but it does not work due to a gyp
26 # issue.
27 'common_net',
28 'common_version',
29 'metrics_proto',
30 '<(DEPTH)/base/base.gyp:base',
31 '<(DEPTH)/base/base.gyp:base_i18n',
32 '<(DEPTH)/base/base.gyp:base_prefs',
33 '<(DEPTH)/base/base.gyp:base_static',
34 '<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
35 '<(DEPTH)/chrome/chrome_resources.gyp:chrome_resources',
36 '<(DEPTH)/chrome/chrome_resources.gyp:chrome_strings',
37 '<(DEPTH)/chrome/chrome_resources.gyp:theme_resources',
38 '<(DEPTH)/chrome/common_constants.gyp:common_constants',
39 '<(DEPTH)/content/content.gyp:content_common',
40 '<(DEPTH)/net/net.gyp:net',
41 '<(DEPTH)/skia/skia.gyp:skia',
42 '<(DEPTH)/third_party/bzip2/bzip2.gyp:bzip2',
43 '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
44 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
45 '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
46 '<(DEPTH)/third_party/mt19937ar/mt19937ar.gyp:mt19937ar',
47 '<(DEPTH)/third_party/sqlite/sqlite.gyp:sqlite',
48 '<(DEPTH)/third_party/zlib/zlib.gyp:minizip',
49 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
50 '<(DEPTH)/ui/ui.gyp:ui_resources',
51 '<(DEPTH)/webkit/support/webkit_support.gyp:user_agent',
52 ],
53 'sources': [
54 'common/all_messages.h',
55 'common/attrition_experiments.h',
56 'common/auto_start_linux.cc',
57 'common/auto_start_linux.h',
58 'common/autofill_messages.h',
59 'common/automation_constants.cc',
60 'common/automation_constants.h',
61 'common/automation_events.cc',
62 'common/automation_events.h',
63 'common/automation_id.cc',
64 'common/automation_id.h',
65 'common/automation_messages.cc',
66 'common/automation_messages.h',
67 'common/automation_messages_internal.h',
68 'common/badge_util.cc',
69 'common/badge_util.h',
70 'common/bzip2_error_handler.cc',
71 'common/cancelable_task_tracker.cc',
72 'common/cancelable_task_tracker.h',
73 'common/child_process_logging.h',
74 'common/child_process_logging_mac.mm',
75 'common/child_process_logging_posix.cc',
76 'common/child_process_logging_win.cc',
77 'common/chrome_content_client.cc',
78 'common/chrome_content_client.h',
79 'common/chrome_notification_types.h',
80 'common/chrome_result_codes.h',
81 'common/chrome_sandbox_type_mac.h',
82 'common/chrome_utility_messages.h',
83 'common/chrome_version_info.cc',
84 'common/chrome_version_info_android.cc',
85 'common/chrome_version_info_chromeos.cc',
86 'common/chrome_version_info_posix.cc',
87 'common/chrome_version_info_mac.mm',
88 'common/chrome_version_info_win.cc',
89 'common/chrome_version_info.h',
90 'common/cloud_print/cloud_print_class_mac.h',
91 'common/cloud_print/cloud_print_class_mac.mm',
92 'common/cloud_print/cloud_print_helpers.cc',
93 'common/cloud_print/cloud_print_helpers.h',
94 'common/cloud_print/cloud_print_proxy_info.cc',
95 'common/cloud_print/cloud_print_proxy_info.h',
96 'common/common_message_generator.cc',
97 'common/common_message_generator.h',
98 'common/common_param_traits.cc',
99 'common/common_param_traits.h',
100 'common/common_param_traits_macros.h',
101 'common/content_settings.cc',
102 'common/content_settings.h',
103 'common/content_settings_helper.cc',
104 'common/content_settings_helper.h',
105 'common/content_settings_pattern.cc',
106 'common/content_settings_pattern.h',
107 'common/content_settings_pattern_parser.cc',
108 'common/content_settings_pattern_parser.h',
109 'common/content_settings_types.h',
110 'common/custom_handlers/protocol_handler.cc',
111 'common/custom_handlers/protocol_handler.h',
112 'common/descriptors_android.h',
113 'common/extensions/command.cc',
114 'common/extensions/command.h',
115 'common/extensions/csp_validator.cc',
116 'common/extensions/csp_validator.h',
117 'common/extensions/draggable_region.cc',
118 'common/extensions/draggable_region.h',
119 'common/extensions/event_filter.cc',
120 'common/extensions/event_filter.h',
121 'common/extensions/event_filtering_info.cc',
122 'common/extensions/event_filtering_info.h',
123 'common/extensions/event_matcher.cc',
124 'common/extensions/event_matcher.h',
125 'common/extensions/extension.cc',
126 'common/extensions/extension.h',
127 'common/extensions/extension_constants.cc',
128 'common/extensions/extension_constants.h',
129 'common/extensions/extension_error_utils.cc',
130 'common/extensions/extension_error_utils.h',
131 'common/extensions/extension_file_util.cc',
132 'common/extensions/extension_file_util.h',
133 'common/extensions/extension_icon_set.cc',
134 'common/extensions/extension_icon_set.h',
135 'common/extensions/extension_l10n_util.cc',
136 'common/extensions/extension_l10n_util.h',
137 'common/extensions/extension_localization_peer.cc',
138 'common/extensions/extension_localization_peer.h',
139 'common/extensions/extension_manifest_constants.cc',
140 'common/extensions/extension_manifest_constants.h',
141 'common/extensions/extension_messages.cc',
142 'common/extensions/extension_messages.h',
143 'common/extensions/extension_process_policy.cc',
144 'common/extensions/extension_process_policy.h',
145 'common/extensions/extension_resource.cc',
146 'common/extensions/extension_resource.h',
147 'common/extensions/extension_set.cc',
148 'common/extensions/extension_set.h',
149 'common/extensions/feature_switch.cc',
150 'common/extensions/feature_switch.h',
151 'common/extensions/features/feature.cc',
152 'common/extensions/features/feature.h',
153 'common/extensions/features/feature_provider.h',
154 'common/extensions/features/manifest_feature.cc',
155 'common/extensions/features/manifest_feature.h',
156 'common/extensions/features/permission_feature.cc',
157 'common/extensions/features/permission_feature.h',
158 'common/extensions/features/simple_feature_provider.cc',
159 'common/extensions/features/simple_feature_provider.h',
160 'common/extensions/file_browser_handler.cc',
161 'common/extensions/file_browser_handler.h',
162 'common/extensions/manifest.cc',
163 'common/extensions/manifest.h',
164 'common/extensions/matcher/regex_set_matcher.cc',
165 'common/extensions/matcher/regex_set_matcher.h',
166 'common/extensions/matcher/string_pattern.cc',
167 'common/extensions/matcher/string_pattern.h',
168 'common/extensions/matcher/substring_set_matcher.cc',
169 'common/extensions/matcher/substring_set_matcher.h',
170 'common/extensions/matcher/url_matcher.cc',
171 'common/extensions/matcher/url_matcher.h',
172 'common/extensions/matcher/url_matcher_constants.cc',
173 'common/extensions/matcher/url_matcher_constants.h',
174 'common/extensions/matcher/url_matcher_factory.cc',
175 'common/extensions/matcher/url_matcher_factory.h',
176 'common/extensions/matcher/url_matcher_helpers.cc',
177 'common/extensions/matcher/url_matcher_helpers.h',
178 'common/extensions/message_bundle.cc',
179 'common/extensions/message_bundle.h',
180 'common/extensions/permissions/api_permission.cc',
181 'common/extensions/permissions/api_permission.h',
182 'common/extensions/permissions/api_permission_set.cc',
183 'common/extensions/permissions/api_permission_set.h',
184 'common/extensions/permissions/permission_message.cc',
185 'common/extensions/permissions/permission_message.h',
186 'common/extensions/permissions/permission_set.cc',
187 'common/extensions/permissions/permission_set.h',
188 'common/extensions/permissions/permissions_info.cc',
189 'common/extensions/permissions/permissions_info.h',
190 'common/extensions/permissions/socket_permission.cc',
191 'common/extensions/permissions/socket_permission.h',
192 'common/extensions/permissions/socket_permission_data.cc',
193 'common/extensions/permissions/socket_permission_data.h',
194 'common/extensions/request_media_access_permission_helper.cc',
195 'common/extensions/request_media_access_permission_helper.h',
196 'common/extensions/unpacker.cc',
197 'common/extensions/unpacker.h',
198 'common/extensions/update_manifest.cc',
199 'common/extensions/update_manifest.h',
200 'common/extensions/url_pattern.cc',
201 'common/extensions/url_pattern.h',
202 'common/extensions/url_pattern_set.cc',
203 'common/extensions/url_pattern_set.h',
204 'common/extensions/user_script.cc',
205 'common/extensions/user_script.h',
206 'common/extensions/value_counter.cc',
207 'common/extensions/value_counter.h',
208 'common/extensions/api/extension_api.cc',
209 'common/extensions/api/extension_api.h',
210 'common/external_ipc_fuzzer.h',
211 'common/external_ipc_fuzzer.cc',
212 'common/favicon_url.cc',
213 'common/favicon_url.h',
214 'common/form_data.cc',
215 'common/form_data.h',
216 'common/form_data_predictions.cc',
217 'common/form_data_predictions.h',
218 'common/form_field_data.cc',
219 'common/form_field_data.h',
220 'common/form_field_data_predictions.cc',
221 'common/form_field_data_predictions.h',
222 'common/icon_messages.h',
223 'common/instant_types.cc',
224 'common/instant_types.h',
225 'common/json_schema_constants.cc',
226 'common/json_schema_constants.h',
227 'common/json_schema_validator.cc',
228 'common/json_schema_validator.h',
229 'common/jstemplate_builder.cc',
230 'common/jstemplate_builder.h',
231 'common/localized_error.cc',
232 'common/localized_error.h',
233 'common/logging_chrome.cc',
234 'common/logging_chrome.h',
235 'common/mac/app_mode_common.h',
236 'common/mac/app_mode_common.mm',
237 'common/mac/cfbundle_blocker.h',
238 'common/mac/cfbundle_blocker.mm',
239 'common/mac/launchd.h',
240 'common/mac/launchd.mm',
241 'common/mac/nscoder_util.h',
242 'common/mac/nscoder_util.mm',
243 'common/mac/objc_method_swizzle.h',
244 'common/mac/objc_method_swizzle.mm',
245 'common/mac/objc_zombie.h',
246 'common/mac/objc_zombie.mm',
247 'common/metrics/entropy_provider.cc',
248 'common/metrics/entropy_provider.h',
249 'common/metrics/metrics_log_base.cc',
250 'common/metrics/metrics_log_base.h',
251 'common/metrics/metrics_log_manager.cc',
252 'common/metrics/metrics_log_manager.h',
253 'common/metrics/metrics_service_base.cc',
254 'common/metrics/metrics_service_base.h',
255 'common/metrics/metrics_util.cc',
256 'common/metrics/metrics_util.h',
257 'common/metrics/variations/variations_util.cc',
258 'common/metrics/variations/variations_util.h',
259 'common/multi_process_lock.h',
260 'common/multi_process_lock_linux.cc',
261 'common/multi_process_lock_mac.cc',
262 'common/multi_process_lock_win.cc',
263 'common/nacl_cmd_line.cc',
264 'common/nacl_cmd_line.h',
265 'common/nacl_messages.cc',
266 'common/nacl_messages.h',
267 'common/nacl_types.cc',
268 'common/nacl_types.h',
269 'common/password_form_fill_data.cc',
270 'common/password_form_fill_data.h',
271 'common/password_generation_util.cc',
272 'common/password_generation_util.h',
273 'common/pepper_flash.cc',
274 'common/pepper_flash.h',
275 'common/pref_names_util.cc',
276 'common/pref_names_util.h',
277 'common/print_messages.cc',
278 'common/print_messages.h',
279 'common/profiling.cc',
280 'common/profiling.h',
281 'common/ref_counted_util.h',
282 'common/render_messages.cc',
283 'common/render_messages.h',
284 'common/safe_browsing/safebrowsing_messages.h',
285 'common/search_provider.h',
286 'common/service_messages.h',
287 'common/service_process_util.cc',
288 'common/service_process_util.h',
289 'common/service_process_util_linux.cc',
290 'common/service_process_util_mac.mm',
291 'common/service_process_util_posix.cc',
292 'common/service_process_util_posix.h',
293 'common/service_process_util_win.cc',
294 'common/spellcheck_common.cc',
295 'common/spellcheck_common.h',
296 'common/spellcheck_messages.h',
297 'common/spellcheck_result.h',
298 'common/startup_metric_utils.cc',
299 'common/startup_metric_utils.h',
300 'common/switch_utils.cc',
301 'common/switch_utils.h',
302 'common/thumbnail_score.cc',
303 'common/thumbnail_score.h',
304 'common/time_format.cc',
305 'common/time_format.h',
306 'common/url_constants.cc',
307 'common/url_constants.h',
308 'common/view_type.cc',
309 'common/view_type.h',
310 'common/visitedlink_common.cc',
311 'common/visitedlink_common.h',
312 'common/web_apps.cc',
313 'common/web_apps.h',
314 'common/web_resource/web_resource_unpacker.cc',
315 'common/web_resource/web_resource_unpacker.h',
316 'common/worker_thread_ticker.cc',
317 'common/worker_thread_ticker.h',
318 'common/zip.cc', # Requires zlib directly.
319 'common/zip.h',
320 'common/zip_internal.cc',
321 'common/zip_internal.h',
322 'common/zip_reader.cc',
323 'common/zip_reader.h',
324 ],
325 'conditions': [
326 ['OS != "ios"', {
327 'dependencies': [
328 '<(DEPTH)/chrome/app/policy/cloud_policy_codegen.gyp:policy',
329 '<(DEPTH)/chrome/common/extensions/api/api.gyp:api',
330 '<(DEPTH)/ipc/ipc.gyp:ipc',
331 '<(DEPTH)/printing/printing.gyp:printing',
332 '<(DEPTH)/third_party/adobe/flash/flash_player.gyp:flapper_version_h',
333 '<(DEPTH)/third_party/re2/re2.gyp:re2',
334 '<(DEPTH)/third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
335 '<(DEPTH)/webkit/support/webkit_support.gyp:glue',
336 ],
337 }, { # OS == ios
338 'sources/': [
339 ['exclude', '^common/automation_'],
340 ['exclude', '^common/child_process_'],
341 ['exclude', '^common/chrome_content_client\\.cc$'],
342 ['exclude', '^common/chrome_version_info_posix\\.cc$'],
343 ['exclude', '^common/common_message_generator\\.cc$'],
344 ['exclude', '^common/common_param_traits'],
345 ['exclude', '^common/custom_handlers/'],
346 ['exclude', '^common/extensions/'],
347 ['exclude', '^common/external_ipc_fuzzer\\.'],
348 ['exclude', '^common/logging_chrome\\.'],
349 ['exclude', '^common/multi_process_'],
350 ['exclude', '^common/nacl_'],
351 ['exclude', '^common/pepper_flash\\.'],
352 ['exclude', '^common/profiling\\.'],
353 ['exclude', '^common/service_process_util_'],
354 ['exclude', '^common/spellcheck_'],
355 ['exclude', '^common/web_apps\\.'],
356 # TODO(ios): Include files here as they are made to work; once
357 # everything is online, remove everything below here and just
358 # use the exclusions above.
359 ['exclude', '.*'],
360 ],
361 }],
362 ['OS=="android"', {
363 'sources/': [
364 ['exclude', '^common/chrome_version_info_posix.cc'],
365 ['exclude', '^common/service_'],
366 ],
367 'dependencies!': [
368 '<(DEPTH)/chrome/app/policy/cloud_policy_codegen.gyp:policy',
369 ],
370 }],
371 ['OS=="win"', {
372 'include_dirs': [
373 '<(DEPTH)/third_party/wtl/include',
374 ]
375 }],
376 ['toolkit_uses_gtk == 1', {
377 'dependencies': [
378 '../build/linux/system.gyp:gtk',
379 ],
380 'export_dependent_settings': [
381 '../third_party/sqlite/sqlite.gyp:sqlite',
382 ],
383 'link_settings': {
384 'libraries': [
385 '-lX11',
386 '-lXrender',
387 '-lXss',
388 '-lXext',
389 ],
390 },
391 }],
392 ['OS=="linux" and selinux==1', {
393 'dependencies': [
394 '../build/linux/system.gyp:selinux',
395 ],
396 }],
397 ['chromeos==1', {
398 'sources!': [
399 'common/chrome_version_info_linux.cc',
400 ],
401 }],
402 ['OS=="mac"', {
403 'dependencies': [
404 '../third_party/mach_override/mach_override.gyp:mach_override',
405 ],
406 'include_dirs': [
407 '../third_party/GTM',
408 ],
409 'sources!': [
410 'common/child_process_logging_posix.cc',
411 'common/chrome_version_info_posix.cc',
412 ],
413 }],
414 ['remoting==1', {
415 'dependencies': [
416 '../remoting/remoting.gyp:remoting_client_plugin',
417 ],
418 }],
419 ],
420 'target_conditions': [
421 ['OS == "ios"', {
422 'sources/': [
423 # Pull in specific Mac files for iOS (which have been filtered out
424 # by file name rules).
425 ['include', '^common/chrome_version_info_mac\\.mm$'],
426 ],
427 }],
428 ],
429 'export_dependent_settings': [
430 '../base/base.gyp:base',
431 'metrics_proto',
432 ],
433 },
434 {
435 'target_name': 'common_version',
436 'type': 'none',
437 'conditions': [
438 ['os_posix == 1 and OS != "mac" and OS != "ios"', {
439 'direct_dependent_settings': {
440 'include_dirs': [
441 '<(SHARED_INTERMEDIATE_DIR)',
442 ],
443 },
444 # Because posix_version generates a header, we must set the
445 # hard_dependency flag.
446 'hard_dependency': 1,
447 'actions': [
448 {
449 'action_name': 'posix_version',
450 'variables': {
451 'lastchange_path':
452 '<(DEPTH)/build/util/LASTCHANGE',
453 'version_py_path': 'tools/build/version.py',
454 'version_path': 'VERSION',
455 'template_input_path': 'common/chrome_version_info_posix.h.version',
456 },
457 'conditions': [
458 [ 'branding == "Chrome"', {
459 'variables': {
460 'branding_path':
461 'app/theme/google_chrome/BRANDING',
462 },
463 }, { # else branding!="Chrome"
464 'variables': {
465 'branding_path':
466 'app/theme/chromium/BRANDING',
467 },
468 }],
469 ],
470 'inputs': [
471 '<(template_input_path)',
472 '<(version_path)',
473 '<(branding_path)',
474 '<(lastchange_path)',
475 ],
476 'outputs': [
477 '<(SHARED_INTERMEDIATE_DIR)/chrome/common/chrome_version_info_posix.h',
478 ],
479 'action': [
480 'python',
481 '<(version_py_path)',
482 '-f', '<(version_path)',
483 '-f', '<(branding_path)',
484 '-f', '<(lastchange_path)',
485 '<(template_input_path)',
486 '<@(_outputs)',
487 ],
488 'message': 'Generating version information',
489 },
490 ],
491 }],
492 ],
493 },
494 {
495 'target_name': 'common_net',
496 'type': 'static_library',
497 'sources': [
498 'common/net/net_resource_provider.cc',
499 'common/net/net_resource_provider.h',
500 'common/net/predictor_common.h',
501 'common/net/url_util.cc',
502 'common/net/url_util.h',
503 'common/net/x509_certificate_model.cc',
504 'common/net/x509_certificate_model_nss.cc',
505 'common/net/x509_certificate_model_openssl.cc',
506 'common/net/x509_certificate_model.h',
507 ],
508 'dependencies': [
509 '<(DEPTH)/base/base.gyp:base',
510 '<(DEPTH)/chrome/chrome_resources.gyp:chrome_resources',
511 '<(DEPTH)/chrome/chrome_resources.gyp:chrome_strings',
512 '<(DEPTH)/crypto/crypto.gyp:crypto',
513 '<(DEPTH)/net/net.gyp:net_resources',
514 '<(DEPTH)/net/net.gyp:net',
515 '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
516 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
517 ],
518 'conditions': [
519 ['OS != "ios"', {
520 'dependencies': [
521 '<(DEPTH)/gpu/gpu.gyp:gpu_ipc',
522 ],
523 }, { # OS == ios
524 'sources!': [
525 'common/net/net_resource_provider.cc',
526 'common/net/x509_certificate_model.cc',
527 ],
528 }],
529 ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
530 'dependencies': [
531 '../build/linux/system.gyp:ssl',
532 ],
533 },
534 ],
535 ['os_posix != 1 or OS == "mac" or OS == "ios"', {
536 'sources!': [
537 'common/net/x509_certificate_model_nss.cc',
538 'common/net/x509_certificate_model_openssl.cc',
539 ],
540 },
541 ],
542 ['OS == "android"', {
543 'dependencies': [
544 '../third_party/openssl/openssl.gyp:openssl',
545 ],
546 },
547 ],
548 ['use_openssl==1', {
549 'sources!': [
550 'common/net/x509_certificate_model_nss.cc',
551 ],
552 },
553 { # else !use_openssl: remove the unneeded files
554 'sources!': [
555 'common/net/x509_certificate_model_openssl.cc',
556 ],
557 },
558 ],
559 ],
560 },
561 {
562 # Protobuf compiler / generator for the safebrowsing client
563 # model proto and the client-side detection (csd) request
564 # protocol buffer.
565 'target_name': 'safe_browsing_proto',
566 'type': 'static_library',
567 'sources': [
568 'common/safe_browsing/client_model.proto',
569 'common/safe_browsing/csd.proto'
570 ],
571 'variables': {
572 'proto_in_dir': 'common/safe_browsing',
573 'proto_out_dir': 'chrome/common/safe_browsing',
574 },
575 'includes': [ '../build/protoc.gypi' ],
576 },
577 {
578 # Protobuf compiler / generator for UMA (User Metrics Analysis).
579 'target_name': 'metrics_proto',
580 'type': 'static_library',
581 'sources': [
582 'common/metrics/proto/chrome_experiments.proto',
583 'common/metrics/proto/chrome_user_metrics_extension.proto',
584 'common/metrics/proto/histogram_event.proto',
585 'common/metrics/proto/omnibox_event.proto',
586 'common/metrics/proto/profiler_event.proto',
587 'common/metrics/proto/system_profile.proto',
588 'common/metrics/proto/user_action_event.proto',
589 ],
590 'variables': {
591 'proto_in_dir': 'common/metrics/proto',
592 'proto_out_dir': 'chrome/common/metrics/proto',
593 },
594 'includes': [ '../build/protoc.gypi' ],
595 },
596 ],
597}