• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2009 Google Inc. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7#
8#     * Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
10#     * Redistributions in binary form must reproduce the above
11# copyright notice, this list of conditions and the following disclaimer
12# in the documentation and/or other materials provided with the
13# distribution.
14#     * Neither the name of Google Inc. nor the names of its
15# contributors may be used to endorse or promote products derived from
16# this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29#
30
31{
32  'includes': [
33    # FIXME: Sense whether upstream or downstream build, and
34    # include the right features.gypi
35    '../../WebKit/chromium/features.gypi',
36    '../JavaScriptCore.gypi',
37  ],
38  'variables': {
39    # Location of the chromium src directory.
40    'conditions': [
41      ['inside_chromium_build==0', {
42        # Webkit is being built outside of the full chromium project.
43        'chromium_src_dir': '../../WebKit/chromium',
44      },{
45        # WebKit is checked out in src/chromium/third_party/WebKit
46        'chromium_src_dir': '../../../..',
47      }],
48    ],
49  },
50  'targets': [
51    {
52      # This target sets up defines and includes that are required by WTF and
53      # its dependents.
54      'target_name': 'wtf_config',
55      'type': 'none',
56      'msvs_guid': '2E2D3301-2EC4-4C0F-B889-87073B30F673',
57      'direct_dependent_settings': {
58        'defines': [
59          # Import features_defines from features.gypi
60          '<@(feature_defines)',
61
62          # Turns on #if PLATFORM(CHROMIUM)
63          'BUILDING_CHROMIUM__=1',
64          # Controls wtf/FastMalloc
65          # FIXME: consider moving into config.h
66          'USE_SYSTEM_MALLOC=1',
67        ],
68        'conditions': [
69          ['OS=="win"', {
70            'defines': [
71              '__STD_C',
72              '_CRT_SECURE_NO_DEPRECATE',
73              '_SCL_SECURE_NO_DEPRECATE',
74              'CRASH=__debugbreak',
75            ],
76            'include_dirs': [
77              '../os-win32',
78            ],
79          }],
80          ['OS=="mac"', {
81            'defines': [
82              # Use USE_NEW_THEME on Mac.
83              'WTF_USE_NEW_THEME=1',
84            ],
85          }],
86          ['OS=="linux" or OS=="freebsd"', {
87            'defines': [
88              'WTF_USE_PTHREADS=1',
89            ],
90          }],
91        ],
92      }
93    },
94    {
95      'target_name': 'wtf',
96      'type': '<(library)',
97      'msvs_guid': 'AA8A5A85-592B-4357-BC60-E0E91E026AF6',
98      'dependencies': [
99        'wtf_config',
100        '<(chromium_src_dir)/third_party/icu/icu.gyp:icui18n',
101        '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
102      ],
103      'include_dirs': [
104        '../',
105        '../wtf',
106        '../wtf/unicode',
107      ],
108      'sources': [
109        '<@(javascriptcore_files)',
110      ],
111      'sources/': [
112        # First exclude everything ...
113        ['exclude', '../'],
114        # ... Then include what we want.
115        ['include', '../wtf/'],
116        # GLib/GTK, even though its name doesn't really indicate.
117        ['exclude', '/(gtk|glib)/.*\\.(cpp|h)$'],
118        ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx)\\.(cpp|mm)$'],
119        ['exclude', 'wtf/CurrentTime\\.cpp$'],
120        ['exclude', 'wtf/TC.*\\.(cpp|h)$'],
121      ],
122      'direct_dependent_settings': {
123        'include_dirs': [
124          '../',
125          '../wtf',
126        ],
127      },
128      'export_dependent_settings': [
129        'wtf_config',
130        '<(chromium_src_dir)/third_party/icu/icu.gyp:icui18n',
131        '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
132      ],
133      'msvs_disabled_warnings': [4127, 4355, 4510, 4512, 4610, 4706],
134      'conditions': [
135        ['OS=="win"', {
136          'sources/': [
137            ['exclude', 'ThreadIdentifierDataPthreads\\.(h|cpp)$'],
138            ['exclude', 'ThreadingPthreads\\.cpp$'],
139            ['include', 'Thread(ing|Specific)Win\\.cpp$']
140          ],
141          'include_dirs!': [
142            '<(SHARED_INTERMEDIATE_DIR)/webkit',
143          ],
144        }],
145      ],
146    },
147    {
148      'target_name': 'pcre',
149      'type': '<(library)',
150      'dependencies': [
151        'wtf',
152      ],
153      'conditions': [
154        ['OS=="win"', {
155          'dependencies': ['<(chromium_src_dir)/build/win/system.gyp:cygwin'],
156        }],
157      ],
158      'msvs_guid': '49909552-0B0C-4C14-8CF6-DB8A2ADE0934',
159      'actions': [
160        {
161          'action_name': 'dftables',
162          'inputs': [
163            '../pcre/dftables',
164          ],
165          'outputs': [
166            '<(INTERMEDIATE_DIR)/chartables.c',
167          ],
168          'action': ['perl', '-w', '<@(_inputs)', '<@(_outputs)'],
169        },
170      ],
171      'include_dirs': [
172        '<(INTERMEDIATE_DIR)',
173      ],
174      'sources': [
175        '<@(javascriptcore_files)',
176      ],
177      'sources/': [
178        # First exclude everything ...
179        ['exclude', '../'],
180        # ... Then include what we want.
181        ['include', '../pcre/'],
182        # ucptable.cpp is #included by pcre_ucp_searchfunchs.cpp and is not
183        # intended to be compiled directly.
184        ['exclude', '../pcre/ucptable.cpp$'],
185      ],
186      'export_dependent_settings': [
187        'wtf',
188      ],
189    },
190  ], # targets
191}
192