base.gypi revision c407dc5cd9bdc5668497f21b26b09d988ab439de
1# Copyright (c) 2010 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  'target_defaults': {
7    'variables': {
8      'base_target': 0,
9      'base_extra_target': 0,
10    },
11    'target_conditions': [
12      # This part is shared between the targets defined below.
13      ['base_target==1', {
14        'sources': [
15          '../build/build_config.h',
16          'third_party/dmg_fp/dmg_fp.h',
17          'third_party/dmg_fp/dtoa.cc',
18          'third_party/dmg_fp/g_fmt.cc',
19          'third_party/icu/icu_utf.cc',
20          'third_party/icu/icu_utf.h',
21          'third_party/nspr/prtime.cc',
22          'third_party/nspr/prtime.h',
23          'at_exit.cc',
24          'at_exit.h',
25          'atomic_ref_count.h',
26          'atomic_sequence_num.h',
27          'atomicops.h',
28          'atomicops_internals_x86_gcc.cc',
29          'atomicops_internals_x86_msvc.h',
30          'base_paths.cc',
31          'base_paths.h',
32          'base_paths_mac.h',
33          'base_paths_mac.mm',
34          'base_paths_posix.cc',
35          'base_paths_win.cc',
36          'base_paths_win.h',
37          'base_switches.cc',
38          'base_switches.h',
39          'basictypes.h',
40          'bits.h',
41          'bzip2_error_handler.cc',
42          'callback.h',
43          'cancellation_flag.cc',
44          'cancellation_flag.h',
45          'chrome_application_mac.h',
46          'chrome_application_mac.mm',
47          'cocoa_protocols_mac.h',
48          'command_line.cc',
49          'command_line.h',
50          'compiler_specific.h',
51          'condition_variable.h',
52          'condition_variable_posix.cc',
53          'condition_variable_win.cc',
54          'cpu.cc',
55          'cpu.h',
56          'debug_on_start.cc',
57          'debug_on_start.h',
58          'debug_util.cc',
59          'debug_util.h',
60          'debug_util_mac.cc',
61          'debug_util_posix.cc',
62          'debug_util_win.cc',
63          'dir_reader_fallback.h',
64          'dir_reader_linux.h',
65          'dir_reader_posix.h',
66          'env_var.cc',
67          'env_var.h',
68          'event_trace_consumer_win.h',
69          'event_trace_controller_win.cc',
70          'event_trace_controller_win.h',
71          'event_trace_provider_win.cc',
72          'event_trace_provider_win.h',
73          'event_synthesis_gtk.cc',
74          'event_synthesis_gtk.h',
75          'file_path.cc',
76          'file_path.h',
77          'file_util.cc',
78          'file_util.h',
79          'file_util_deprecated.h',
80          'file_util_mac.mm',
81          'file_util_posix.cc',
82          'file_util_win.cc',
83          'file_version_info.h',
84          'file_version_info_mac.h',
85          'file_version_info_mac.mm',
86          'file_version_info_win.cc',
87          'file_version_info_win.h',
88          'fix_wp64.h',
89          'float_util.h',
90          'foundation_utils_mac.h',
91          'global_descriptors_posix.cc',
92          'global_descriptors_posix.h',
93          'gtest_prod_util.h',
94          'gtk_util.cc',
95          'gtk_util.h',
96          'hash_tables.h',
97          'histogram.cc',
98          'histogram.h',
99          'iat_patch.cc',
100          'iat_patch.h',
101          'id_map.h',
102          'lazy_instance.cc',
103          'lazy_instance.h',
104          'leak_annotations.h',
105          'leak_tracker.h',
106          'linked_list.h',
107          'linked_ptr.h',
108          'lock.cc',
109          'lock.h',
110          'lock_impl.h',
111          'lock_impl_posix.cc',
112          'lock_impl_win.cc',
113          'logging.cc',
114          'logging.h',
115          'logging_win.cc',
116          'mac_util.h',
117          'mac_util.mm',
118          'mach_ipc_mac.h',
119          'mach_ipc_mac.mm',
120          'memory_debug.cc',
121          'memory_debug.h',
122          'message_loop.cc',
123          'message_loop.h',
124          'message_loop_proxy.h',
125          'message_loop_proxy_impl.cc',
126          'message_loop_proxy_impl.h',
127          'message_pump.h',
128          'message_pump_default.cc',
129          'message_pump_default.h',
130          'message_pump_win.cc',
131          'message_pump_win.h',
132          'mime_util.h',
133          'mime_util_xdg.cc',
134          'move.h',
135          'native_library.h',
136          'native_library_linux.cc',
137          'native_library_mac.mm',
138          'native_library_win.cc',
139          'non_thread_safe.cc',
140          'non_thread_safe.h',
141          'nullable_string16.h',
142          'object_watcher.cc',
143          'object_watcher.h',
144          'observer_list.h',
145          'observer_list_threadsafe.h',
146          'path_service.cc',
147          'path_service.h',
148          'pe_image.cc',
149          'pe_image.h',
150          'pickle.cc',
151          'pickle.h',
152          'platform_file.h',
153          'platform_file_posix.cc',
154          'platform_file_win.cc',
155          'platform_thread.h',
156          'platform_thread_mac.mm',
157          'platform_thread_posix.cc',
158          'platform_thread_win.cc',
159          'port.h',
160          'process.h',
161          'process_linux.cc',
162          'process_posix.cc',
163          'process_util.cc',
164          'process_util.h',
165          'process_util_linux.cc',
166          'process_util_mac.mm',
167          'process_util_posix.cc',
168          'process_util_win.cc',
169          'process_win.cc',
170          'profiler.cc',
171          'profiler.h',
172          'rand_util.cc',
173          'rand_util.h',
174          'rand_util_posix.cc',
175          'rand_util_win.cc',
176          'raw_scoped_refptr_mismatch_checker.h',
177          'ref_counted.cc',
178          'ref_counted.h',
179          'ref_counted_memory.h',
180          'registry.cc',
181          'registry.h',
182          'resource_util.cc',
183          'resource_util.h',
184          'safe_strerror_posix.cc',
185          'safe_strerror_posix.h',
186          'scoped_bstr_win.cc',
187          'scoped_bstr_win.h',
188          'scoped_cftyperef.h',
189          'scoped_comptr_win.h',
190          'scoped_handle.h',
191          'scoped_handle_win.h',
192          'scoped_nsautorelease_pool.h',
193          'scoped_nsautorelease_pool.mm',
194          'scoped_nsdisable_screen_updates.h',
195          'scoped_nsobject.h',
196          'scoped_open_process.h',
197          'scoped_ptr.h',
198          'scoped_temp_dir.cc',
199          'scoped_temp_dir.h',
200          'scoped_variant_win.cc',
201          'scoped_variant_win.h',
202          'scoped_vector.h',
203          'sha1.h',
204          'sha1_portable.cc',
205          'sha1_win.cc',
206          'shared_memory.h',
207          'shared_memory_posix.cc',
208          'shared_memory_win.cc',
209          'simple_thread.cc',
210          'simple_thread.h',
211          'singleton.h',
212          'spin_wait.h',
213          'stack_container.h',
214          'stats_counters.h',
215          'stats_table.cc',
216          'stats_table.h',
217          'stl_util-inl.h',
218          'string_piece.cc',
219          'string_piece.h',
220          'string_split.cc',
221          'string_split.h',
222          'string_tokenizer.h',
223          'string_util.cc',
224          'string_util.h',
225          'string_util_win.h',
226          'sys_info.h',
227          'sys_info_chromeos.cc',
228          'sys_info_freebsd.cc',
229          'sys_info_linux.cc',
230          'sys_info_mac.cc',
231          'sys_info_openbsd.cc',
232          'sys_info_posix.cc',
233          'sys_info_win.cc',
234          'sys_string_conversions.h',
235          'sys_string_conversions_linux.cc',
236          'sys_string_conversions_mac.mm',
237          'sys_string_conversions_win.cc',
238          'task.cc',
239          'task.h',
240          'template_util.h',
241          'thread.cc',
242          'thread.h',
243          'thread_collision_warner.cc',
244          'thread_collision_warner.h',
245          'thread_local.h',
246          'thread_local_posix.cc',
247          'thread_local_storage.h',
248          'thread_local_storage_posix.cc',
249          'thread_local_storage_win.cc',
250          'thread_local_win.cc',
251          'time.cc',
252          'time.h',
253          'time_win.cc',
254          'timer.cc',
255          'timer.h',
256          'trace_event_win.cc',
257          'trace_event.cc',
258          'trace_event.h',
259          'tracked.cc',
260          'tracked.h',
261          'tracked_objects.cc',
262          'tracked_objects.h',
263          'tuple.h',
264          'unix_domain_socket_posix.cc',
265          'utf_offset_string_conversions.cc',
266          'utf_offset_string_conversions.h',
267          'utf_string_conversion_utils.cc',
268          'utf_string_conversion_utils.h',
269          'utf_string_conversions.cc',
270          'utf_string_conversions.h',
271          'values.cc',
272          'values.h',
273          'waitable_event.h',
274          'waitable_event_posix.cc',
275          'waitable_event_watcher.h',
276          'waitable_event_watcher_posix.cc',
277          'waitable_event_watcher_win.cc',
278          'waitable_event_win.cc',
279          'watchdog.cc',
280          'watchdog.h',
281          'weak_ptr.cc',
282          'weak_ptr.h',
283          'win_util.cc',
284          'win_util.h',
285          'windows_message_list.h',
286          'wmi_util.cc',
287          'wmi_util.h',
288          'worker_pool.h',
289          'worker_pool_linux.cc',
290          'worker_pool_linux.h',
291          'worker_pool_mac.h',
292          'worker_pool_mac.mm',
293          'worker_pool_win.cc',
294          'xdg_util.h',
295          'xdg_util.cc',
296        ],
297        'include_dirs': [
298          '..',
299        ],
300        # These warnings are needed for the files in third_party\dmg_fp.
301        'msvs_disabled_warnings': [
302          4244, 4554, 4018, 4102,
303        ],
304        'mac_framework_dirs': [
305          '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
306        ],
307        'conditions': [
308          [ 'OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris"', {
309              'sources/': [
310                ['exclude', '/xdg_[^/]*\\.cc$'],
311              ],
312              'sources!': [
313                'atomicops_internals_x86_gcc.cc',
314                'base_paths_posix.cc',
315                'message_pump_glib.cc',
316                'xdg_util.cc',
317              ],
318          }],
319          [ 'OS != "linux"', {
320              'sources!': [
321                # Not automatically excluded by the *linux.cc rules.
322                'gtk_util.cc',
323                'gtk_util.h',
324                'linux_util.cc',
325                'setproctitle_linux.c',
326                'setproctitle_linux.h',
327              ],
328            },
329          ],
330          # For now, just test the *BSD platforms enough to exclude them.
331          # Subsequent changes will include them further.
332          [ 'OS != "freebsd"', {
333              'sources/': [ ['exclude', '_freebsd\\.cc$'] ],
334            },
335          ],
336          [ 'OS != "openbsd"', {
337              'sources/': [ ['exclude', '_openbsd\\.cc$'] ],
338            },
339          ],
340          [ 'OS == "win"', {
341              'include_dirs': [
342                '<(DEPTH)/third_party/wtl/include',
343              ],
344              'sources!': [
345                'event_recorder_stubs.cc',
346                'file_descriptor_shuffle.cc',
347                'message_pump_libevent.cc',
348                # Not using sha1_win.cc because it may have caused a
349                # regression to page cycler moz.
350                'sha1_win.cc',
351                'string16.cc',
352                'trace_event.cc',
353              ],
354          },],
355        ],
356      }],
357      ['base_extra_target==1', {
358        'sources': [
359          'crypto/capi_util.cc',
360          'crypto/capi_util.h',
361          'crypto/cssm_init.cc',
362          'crypto/cssm_init.h',
363          'crypto/encryptor.h',
364          'crypto/encryptor_mac.cc',
365          'crypto/encryptor_nss.cc',
366          'crypto/encryptor_win.cc',
367          'crypto/rsa_private_key.h',
368          'crypto/rsa_private_key.cc',
369          'crypto/rsa_private_key_mac.cc',
370          'crypto/rsa_private_key_nss.cc',
371          'crypto/rsa_private_key_win.cc',
372          'crypto/signature_creator.h',
373          'crypto/signature_creator_mac.cc',
374          'crypto/signature_creator_nss.cc',
375          'crypto/signature_creator_win.cc',
376          'crypto/signature_verifier.h',
377          'crypto/signature_verifier_mac.cc',
378          'crypto/signature_verifier_nss.cc',
379          'crypto/signature_verifier_win.cc',
380          'crypto/symmetric_key.h',
381          'crypto/symmetric_key_mac.cc',
382          'crypto/symmetric_key_nss.cc',
383          'crypto/symmetric_key_win.cc',
384          'third_party/nspr/prcpucfg.h',
385          'third_party/nspr/prcpucfg_win.h',
386          'third_party/nspr/prtypes.h',
387          'third_party/nss/blapi.h',
388          'third_party/nss/blapit.h',
389          'third_party/nss/sha256.h',
390          'third_party/nss/sha512.cc',
391          'third_party/purify/pure.h',
392          'third_party/purify/pure_api.c',
393          'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc',
394          'third_party/xdg_user_dirs/xdg_user_dir_lookup.h',
395          'auto_reset.h',
396          'base64.cc',
397          'base64.h',
398          'base_drag_source.cc',
399          'base_drag_source.h',
400          'base_drop_target.cc',
401          'base_drop_target.h',
402          'data_pack.cc',
403          'event_recorder.cc',
404          'event_recorder.h',
405          'event_recorder_stubs.cc',
406          'field_trial.cc',
407          'field_trial.h',
408          'file_descriptor_shuffle.cc',
409          'file_descriptor_shuffle.h',
410          'hmac.h',
411          'hmac_mac.cc',
412          'hmac_nss.cc',
413          'hmac_win.cc',
414          'image_util.cc',
415          'image_util.h',
416          'json/json_reader.cc',
417          'json/json_reader.h',
418          'json/json_writer.cc',
419          'json/json_writer.h',
420          'json/string_escape.cc',
421          'json/string_escape.h',
422          'keyboard_code_conversion_gtk.cc',
423          'keyboard_code_conversion_gtk.h',
424          'keyboard_codes.h',
425          'keyboard_codes_win.h',
426          'keyboard_codes_posix.h',
427          'linux_util.cc',
428          'linux_util.h',
429          'md5.cc',
430          'md5.h',
431          'message_pump_glib.cc',
432          'message_pump_glib.h',
433          'message_pump_libevent.cc',
434          'message_pump_libevent.h',
435          'message_pump_mac.h',
436          'message_pump_mac.mm',
437          'nsimage_cache_mac.h',
438          'nsimage_cache_mac.mm',
439          'nss_util.cc',
440          'nss_util.h',
441          'setproctitle_linux.c',
442          'setproctitle_linux.h',
443          'sha2.cc',
444          'sha2.h',
445          'string16.cc',
446          'string16.h',
447          'sync_socket.h',
448          'sync_socket_win.cc',
449          'sync_socket_posix.cc',
450          'time_mac.cc',
451          'time_posix.cc',
452          'version.cc',
453          'version.h',
454        ],
455        'conditions': [
456          [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
457            'conditions': [
458              [ 'chromeos==1', {
459                  'sources/': [ ['include', '_chromeos\\.cc$'] ]
460                },
461              ],
462            ],
463            'defines': [
464              'USE_SYMBOLIZE',
465            ],
466            'cflags': [
467              '-Wno-write-strings',
468            ],
469          }, {  # OS != "linux" and OS != "freebsd" and OS != "openbsd" and OS != "solaris"
470              'sources/': [
471                ['exclude', '/xdg_user_dirs/'],
472                ['exclude', '_nss\.cc$'],
473              ],
474          }],
475          [ 'OS != "mac"', {
476              'sources!': [
477                'crypto/cssm_init.cc',
478                'crypto/cssm_init.h',
479              ],
480          },],
481          [ 'OS != "win"', {
482              'sources!': [
483                'third_party/purify/pure_api.c',
484                'base_drag_source.cc',
485                'base_drop_target.cc',
486                'cpu.cc',
487                'crypto/capi_util.h',
488                'crypto/capi_util.cc',
489                'debug_on_start.cc',
490                'event_recorder.cc',
491                'file_version_info.cc',
492                'iat_patch.cc',
493                'image_util.cc',
494                'object_watcher.cc',
495                'pe_image.cc',
496                'registry.cc',
497                'resource_util.cc',
498                'win_util.cc',
499                'wmi_util.cc',
500              ],
501          },],
502        ],
503      }],
504    ],
505  },
506  'targets': [
507    {
508      'target_name': 'base',
509      'type': '<(library)',
510      'msvs_guid': '1832A374-8A74-4F9E-B536-69A699B3E165',
511      'variables': {
512        'base_target': 1,
513        'base_extra_target': 1,
514      },
515      'dependencies': [
516        '../third_party/modp_b64/modp_b64.gyp:modp_b64',
517        'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
518      ],
519      # TODO(gregoryd): direct_dependent_settings should be shared with the
520      #  64-bit target, but it doesn't work due to a bug in gyp
521      'direct_dependent_settings': {
522        'include_dirs': [
523          '..',
524        ],
525      },
526      'conditions': [
527        [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', {
528          'conditions': [
529            [ 'linux_use_tcmalloc==0', {
530                'defines': [
531                  'NO_TCMALLOC',
532                ],
533                'direct_dependent_settings': {
534                  'defines': [
535                    'NO_TCMALLOC',
536                  ],
537                },
538              },
539            ],
540            [ 'linux_use_tcmalloc==1', {
541                'dependencies': [
542                  'allocator/allocator.gyp:allocator',
543                ],
544              },
545            ],
546          ],
547          'dependencies': [
548            'symbolize',
549            '../build/util/build_util.gyp:lastchange',
550            '../build/linux/system.gyp:gtk',
551            '../build/linux/system.gyp:nss',
552            'xdg_mime',
553          ],
554          'export_dependent_settings': [
555            '../build/linux/system.gyp:gtk',
556          ],
557        },],
558        [ 'OS == "freebsd" or OS == "openbsd"', {
559          'link_settings': {
560            'libraries': [
561              '-L/usr/local/lib -lexecinfo',
562              ],
563            },
564          },
565        ],
566        [ 'OS == "linux"', {
567          'link_settings': {
568             'libraries': [
569             # We need rt for clock_gettime().
570             '-lrt',
571             # For 'native_library_linux.cc'
572             '-ldl',
573           ],
574         },
575        }],
576        [ 'OS == "mac"', {
577          'link_settings': {
578            'libraries': [
579              '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
580              '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
581              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
582              '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
583              '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
584              '$(SDKROOT)/System/Library/Frameworks/Security.framework',
585            ],
586          },
587        },],
588        [ 'OS == "mac" or OS == "win"', {
589            'dependencies': [
590              '../third_party/nss/nss.gyp:nss',
591            ],
592        },],
593        [ 'OS != "win"', {
594            'dependencies': ['../third_party/libevent/libevent.gyp:libevent'],
595        },],
596      ],
597    },
598  ],
599  'conditions': [
600    [ 'OS == "win"', {
601      'targets': [
602        {
603          'target_name': 'base_nacl_win64',
604          'type': '<(library)',
605          'msvs_guid': 'CEE1F794-DC70-4FED-B7C4-4C12986672FE',
606          'variables': {
607            'base_target': 1,
608          },
609          'dependencies': [
610            'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
611          ],
612          # TODO(gregoryd): direct_dependent_settings should be shared with the
613          # 32-bit target, but it doesn't work due to a bug in gyp
614          'direct_dependent_settings': {
615            'include_dirs': [
616              '..',
617            ],
618          },
619          'defines': [
620            '<@(nacl_win64_defines)',
621          ],
622          'sources': [
623            'i18n/icu_util_nacl_win64.cc',
624          ],
625          'configurations': {
626            'Common_Base': {
627              'msvs_target_platform': 'x64',
628            },
629          },
630        },
631      ],
632    }],
633    [ 'OS == "linux" and internal_pdf', {
634      'targets': [
635        {
636          'target_name': 'base_fpic',
637          'type': '<(library)',
638          'variables': {
639            'base_target': 1,
640            'base_extra_target': 1,
641          },
642          'cflags': [
643            '-fPIC',
644          ],
645          # Official builds set -gstabs, which fails when building with -fPIC.
646          # It's useless on 64 bits anyways because breakpad doesn't work then.
647          'cflags!': [
648            '-gstabs',
649          ],
650          'direct_dependent_settings': {
651            'include_dirs': [
652              '..',
653            ],
654          },
655          'conditions': [
656            [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd"', {
657              'dependencies': [
658                '../build/util/build_util.gyp:lastchange',
659                '../build/linux/system.gyp:gtk',
660                '../build/linux/system.gyp:nss',
661                'xdg_mime',
662              ],
663              'export_dependent_settings': [
664                '../build/linux/system.gyp:gtk',
665              ],
666            },],
667            ['OS == "linux"', {
668              'link_settings': {
669                'libraries': [
670                  # We need rt for clock_gettime().
671                  '-lrt',
672                  # For 'native_library_linux.cc'
673                  '-ldl',
674                ],
675              },
676            }],
677            [ 'OS == "mac" or OS == "win"', {
678                'dependencies': [
679                  '../third_party/nss/nss.gyp:nss',
680                ],
681            },],
682            [ 'OS != "win"', {
683                'dependencies': ['../third_party/libevent/libevent.gyp:libevent'],
684            },],
685          ],
686        },
687      ],
688    }],
689    [ 'OS == "linux" or OS == "freebsd" or OS == "openbsd" or OS == "solaris"', {
690      'targets': [
691        {
692          'target_name': 'symbolize',
693          'type': '<(library)',
694          'variables': {
695            'chromium_code': 0,
696          },
697          'conditions': [
698            [ 'OS == "solaris"', {
699              'include_dirs': [
700                '/usr/gnu/include',
701                '/usr/gnu/include/libelf',
702              ],
703            },],
704          ],
705          'cflags': [
706            '-Wno-sign-compare',
707          ],
708          'cflags!': [
709            '-Wextra',
710          ],
711          'sources': [
712            'third_party/symbolize/symbolize.cc',
713            'third_party/symbolize/demangle.cc',
714          ],
715        },
716        {
717          'target_name': 'xdg_mime',
718          'type': '<(library)',
719          'variables': {
720            'chromium_code': 0,
721          },
722          'cflags!': [
723            '-Wextra',
724          ],
725          'sources': [
726            'third_party/xdg_mime/xdgmime.c',
727            'third_party/xdg_mime/xdgmime.h',
728            'third_party/xdg_mime/xdgmimealias.c',
729            'third_party/xdg_mime/xdgmimealias.h',
730            'third_party/xdg_mime/xdgmimecache.c',
731            'third_party/xdg_mime/xdgmimecache.h',
732            'third_party/xdg_mime/xdgmimeglob.c',
733            'third_party/xdg_mime/xdgmimeglob.h',
734            'third_party/xdg_mime/xdgmimeicon.c',
735            'third_party/xdg_mime/xdgmimeicon.h',
736            'third_party/xdg_mime/xdgmimeint.c',
737            'third_party/xdg_mime/xdgmimeint.h',
738            'third_party/xdg_mime/xdgmimemagic.c',
739            'third_party/xdg_mime/xdgmimemagic.h',
740            'third_party/xdg_mime/xdgmimeparent.c',
741            'third_party/xdg_mime/xdgmimeparent.h',
742          ],
743        },
744      ],
745    }],
746  ],
747}
748