initial import
[vuplus_webkit] / Source / JavaScriptCore / JavaScriptCore.gyp / JavaScriptCore.gyp
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   'conditions': [
51     ['os_posix == 1 and OS != "mac" and gcc_version==46', {
52       'target_defaults': {
53         # Disable warnings about c++0x compatibility, as some names (such as nullptr) conflict
54         # with upcoming c++0x types.
55         'cflags_cc': ['-Wno-c++0x-compat'],
56       },
57     }],
58   ],
59   'targets': [
60     {
61       # This target sets up defines and includes that are required by WTF and
62       # its dependents.
63       'target_name': 'wtf_config',
64       'type': 'none',
65       'msvs_guid': '2E2D3301-2EC4-4C0F-B889-87073B30F673',
66       'direct_dependent_settings': {
67         'defines': [
68           # Import features_defines from features.gypi
69           '<@(feature_defines)',
70           
71           # Turns on #if PLATFORM(CHROMIUM)
72           'BUILDING_CHROMIUM__=1',
73           # Controls wtf/FastMalloc
74           # FIXME: consider moving into config.h
75           'USE_SYSTEM_MALLOC=1',
76         ],
77         'conditions': [
78           ['OS=="win"', {
79             'defines': [
80               '__STD_C',
81               '_CRT_SECURE_NO_DEPRECATE',
82               '_SCL_SECURE_NO_DEPRECATE',
83               'CRASH=__debugbreak',
84             ],
85             'include_dirs': [
86               '../os-win32',
87             ],
88           }],
89           ['OS=="mac"', {
90             'defines': [
91               # Use USE_NEW_THEME on Mac.
92               'WTF_USE_NEW_THEME=1',
93             ],
94           }],
95           ['os_posix == 1 and OS != "mac"', {
96             'defines': [
97               'WTF_USE_PTHREADS=1',
98             ],
99           }],
100         ],
101       }
102     },
103     {
104       'target_name': 'wtf',
105       'type': 'static_library',
106       'msvs_guid': 'AA8A5A85-592B-4357-BC60-E0E91E026AF6',
107       'dependencies': [
108         'wtf_config',
109         '<(chromium_src_dir)/third_party/icu/icu.gyp:icui18n',
110         '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
111       ],
112       'include_dirs': [
113         '../',
114         '../wtf',
115         '../wtf/unicode',
116       ],
117       'sources': [
118         '<@(javascriptcore_publicheader_files)',
119         '<@(javascriptcore_privateheader_files)',
120         '<@(javascriptcore_files)',
121       ],
122       'sources/': [
123         # First exclude everything ...
124         ['exclude', '../'],
125         # ... Then include what we want.
126         ['include', '../wtf/'],
127         # FIXME: This is clearly not sustainable. 
128         ['exclude', '../wtf/brew'], 
129         ['exclude', '../wtf/efl'], 
130         ['exclude', '../wtf/gobject'], 
131         ['exclude', '../wtf/gtk'], 
132         ['exclude', '../wtf/haiku'], 
133         ['exclude', '../wtf/mac'], 
134         ['exclude', '../wtf/qt'], 
135         ['exclude', '../wtf/url'], 
136         ['exclude', '../wtf/wince'], 
137         ['exclude', '../wtf/wx'], 
138         ['exclude', '../wtf/unicode/brew'], 
139         ['exclude', '../wtf/unicode/wince'], 
140         ['exclude', '../wtf/unicode/glib'], 
141         ['exclude', '../wtf/unicode/qt4'], 
142         # GLib/GTK, even though its name doesn't really indicate.
143         ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'],
144         ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx|Efl|Symbian)\\.(cpp|mm)$'],
145         ['exclude', 'wtf/CurrentTime\\.cpp$'],
146         ['exclude', 'wtf/OSRandomSource\\.cpp$'],
147         ['exclude', 'wtf/MainThread.cpp$'],
148         ['exclude', 'wtf/TC.*\\.(cpp|h)$'],
149       ],
150       'direct_dependent_settings': {
151         'include_dirs': [
152           '../',
153           '../wtf',
154         ],
155         # Some warnings occur in JSC headers, so they must also be disabled
156         # in targets that use JSC.
157         'msvs_disabled_warnings': [
158           # Don't complain about calling specific versions of templatized
159           # functions (e.g. in RefPtrHashMap.h).
160           4344,
161           # Don't complain about using "this" in an initializer list
162           # (e.g. in StringImpl.h).
163           4355,
164         ],
165       },
166       'export_dependent_settings': [
167         'wtf_config',
168         '<(chromium_src_dir)/third_party/icu/icu.gyp:icui18n',
169         '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
170       ],
171       'msvs_disabled_warnings': [4127, 4355, 4510, 4512, 4610, 4706],
172       'conditions': [
173         ['OS=="win"', {
174           'sources/': [
175             ['exclude', 'ThreadIdentifierDataPthreads\\.(h|cpp)$'],
176             ['exclude', 'ThreadingPthreads\\.cpp$'],
177             ['include', 'Thread(ing|Specific)Win\\.cpp$'],
178             ['exclude', 'OSAllocatorPosix\\.cpp$'],
179             ['include', 'OSAllocatorWin\\.cpp$']
180           ],
181           'include_dirs!': [
182             '<(SHARED_INTERMEDIATE_DIR)/webkit',
183           ],
184           'conditions': [
185             ['inside_chromium_build==1 and component=="shared_library"', {
186               # Chromium windows multi-dll build enables c++ exception and this
187               # causes wtf generates 4291 warning due to operator new/delete
188               # implementations. Disable the warning for chromium windows
189               # multi-dll build.
190               'msvs_disabled_warnings': [4291],
191               'direct_dependent_settings': {
192                 'msvs_disabled_warnings': [4291],
193               },
194             }],
195           ],
196         }],
197       ],
198     },
199     {
200       'target_name': 'yarr',
201       'type': 'static_library',
202       'dependencies': [
203         'wtf',
204       ],
205       'conditions': [
206         ['OS=="win"', {
207           'dependencies': ['<(chromium_src_dir)/build/win/system.gyp:cygwin'],
208         }],
209       ],
210       'msvs_guid': '49909552-0B0C-4C14-8CF6-DB8A2ADE0934',
211       'actions': [
212         {
213           'action_name': 'retgen',
214           'inputs': [
215             '../create_regex_tables',
216           ],
217           'arguments': [
218             '--no-tables',
219           ],
220           'outputs': [
221             '<(INTERMEDIATE_DIR)/RegExpJitTables.h',
222           ],
223           'action': ['python', '<@(_inputs)', '<@(_arguments)', '<@(_outputs)'],
224         },
225       ],
226       'include_dirs': [
227         '<(INTERMEDIATE_DIR)',
228         '../runtime',
229       ],
230       'sources': [
231         '<@(javascriptcore_files)',
232       ],
233       'sources/': [
234         # First exclude everything ...
235         ['exclude', '../'],
236         # ... Then include what we want.
237         ['include', '../yarr/'],
238         # The Yarr JIT isn't used in WebCore.
239         ['exclude', '../yarr/YarrJIT\\.(h|cpp)$'],
240       ],
241       'export_dependent_settings': [
242         'wtf',
243       ],
244     },
245   ], # targets
246 }
247
248 # Local Variables:
249 # tab-width:2
250 # indent-tabs-mode:nil
251 # End:
252 # vim: set expandtab tabstop=2 shiftwidth=2: