- add third_party src.
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / web / web.gyp
1 #
2 # Copyright (C) 2011 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         '../bindings/bindings.gypi',
34         '../core/core.gypi',
35         '../build/features.gypi',
36         '../build/scripts/scripts.gypi',
37         '../build/win/precompile.gypi',
38         '../modules/modules.gypi',
39         '../wtf/wtf.gypi',
40         'web.gypi',
41     ],
42     'targets': [
43         {
44             'target_name': 'webkit',
45             'type': '<(component)',
46             'variables': { 'enable_wexit_time_destructors': 1, },
47             'dependencies': [
48                 'picker_resources',
49                 '../config.gyp:config',
50                 '../platform/blink_platform.gyp:blink_common',
51                 '../core/core.gyp:webcore',
52                 '../modules/modules.gyp:modules',
53                 '<(DEPTH)/skia/skia.gyp:skia',
54                 '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator',
55                 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
56                 '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
57                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
58             ],
59             'export_dependent_settings': [
60                 '<(DEPTH)/skia/skia.gyp:skia',
61                 '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
62                 '<(DEPTH)/third_party/npapi/npapi.gyp:npapi',
63                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
64             ],
65             'include_dirs': [
66                 '../../public/web',
67                 '../web',
68                 '<(DEPTH)/third_party/angle_dx11/include',
69                 '<(DEPTH)/third_party/skia/include/utils',
70             ],
71             'defines': [
72                 'BLINK_IMPLEMENTATION=1',
73                 'INSIDE_BLINK',
74             ],
75             'sources': [
76                 '<@(webcore_platform_support_files)',
77                 '<@(web_files)',
78             ],
79             'conditions': [
80                 ['component=="shared_library"', {
81                     'dependencies': [
82                         '../core/core.gyp:webcore_derived',
83                         '../core/core.gyp:webcore_test_support',
84                         '../modules/modules.gyp:modules_test_support',
85                         '<(DEPTH)/base/base.gyp:test_support_base',
86                         '<(DEPTH)/testing/gmock.gyp:gmock',
87                         '<(DEPTH)/testing/gtest.gyp:gtest',
88                         '<(DEPTH)/third_party/icu/icu.gyp:*',
89                         '<(libjpeg_gyp_path):libjpeg',
90                         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
91                         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
92                         '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
93                         '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
94                         '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64',
95                         '<(DEPTH)/third_party/ots/ots.gyp:ots',
96                         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
97                         '<(DEPTH)/url/url.gyp:url_lib',
98                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
99                         # We must not add webkit_support here because of cyclic dependency.
100                     ],
101                     'export_dependent_settings': [
102                         '<(DEPTH)/url/url.gyp:url_lib',
103                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
104                     ],
105                     'include_dirs': [
106                         # WARNING: Do not view this particular case as a precedent for
107                         # including WebCore headers in DumpRenderTree project.
108                         '../core/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
109                     ],
110                     'sources': [
111                         # Compile Blink unittest files into webkit.dll in component build mode
112                         # since there're methods that are tested but not exported.
113                         # WebUnitTests.* exports an API that runs all the unittests inside
114                         # webkit.dll.
115                         '<@(bindings_unittest_files)',
116                         '<@(core_unittest_files)',
117                         '<@(modules_unittest_files)',
118                         '<@(web_unittest_files)',
119                         'WebTestingSupport.cpp',
120                         'tests/WebUnitTests.cpp',   # Components test runner support.
121                     ],
122                     'conditions': [
123                         ['OS=="win" or OS=="mac"', {
124                             'dependencies': [
125                                 '<(DEPTH)/third_party/nss/nss.gyp:*',
126                             ],
127                         }],
128                         ['clang==1', {
129                             # FIXME: It would be nice to enable this in shared builds too,
130                             # but the test files have global constructors from the GTEST macro
131                             # and we pull in the test files into the webkit target in the
132                             # shared build.
133                             'cflags!': ['-Wglobal-constructors'],
134                             'xcode_settings': {
135                               'WARNING_CFLAGS!': ['-Wglobal-constructors'],
136                             },
137                         }],
138                     ],
139                     'msvs_settings': {
140                       'VCLinkerTool': {
141                         'conditions': [
142                           ['incremental_chrome_dll==1', {
143                             'UseLibraryDependencyInputs': "true",
144                           }],
145                         ],
146                       },
147                     },
148                 }],
149                 ['OS == "linux"', {
150                     'dependencies': [
151                         '<(DEPTH)/build/linux/system.gyp:fontconfig',
152                     ],
153                     'include_dirs': [
154                         '../../public/web/linux',
155                     ],
156                 }, {
157                     'sources/': [
158                         ['exclude', 'linux/'],
159                     ],
160                 }],
161                 ['use_x11 == 1', {
162                     'dependencies': [
163                         '<(DEPTH)/build/linux/system.gyp:x11',
164                     ],
165                     'include_dirs': [
166                         '../../public/web/x11',
167                     ],
168                 }, {
169                     'sources/': [
170                         ['exclude', 'x11/'],
171                     ]
172                 }],
173                 ['toolkit_uses_gtk == 1', {
174                     'dependencies': [
175                         '<(DEPTH)/build/linux/system.gyp:gtk',
176                     ],
177                     'include_dirs': [
178                         '../../public/web/gtk',
179                     ],
180                 }, { # else: toolkit_uses_gtk != 1
181                     'sources/': [
182                         ['exclude', 'WebInputEventFactoryGtk.cpp$'],
183                     ],
184                 }],
185                 ['OS=="android"', {
186                     'include_dirs': [
187                         '../../public/web/android',
188                         '../../public/web/linux', # We need linux/WebFontRendering.h on Android.
189                     ],
190                 }, { # else: OS!="android"
191                     'sources/': [
192                         ['exclude', 'WebInputEventFactoryAndroid.cpp$'],
193                     ],
194                 }],
195                 ['OS=="mac"', {
196                     'include_dirs': [
197                         '../../public/web/mac',
198                     ],
199                     'link_settings': {
200                         'libraries': [
201                             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
202                             '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
203                         ],
204                     },
205                 }, { # else: OS!="mac"
206                     'sources/': [
207                         ['exclude', 'WebInputEventFactoryMac.mm$'],
208                     ],
209                 }],
210                 ['OS=="win"', {
211                     'include_dirs': [
212                         '../../public/web/win',
213                     ],
214                 }, { # else: OS!="win"
215                     'sources/': [
216                         ['exclude', 'WebInputEventFactoryWin.cpp$'],
217                     ],
218                 }],
219                 ['use_default_render_theme==1', {
220                     'include_dirs': [
221                         '../../public/web/default',
222                     ],
223                 }, { # else use_default_render_theme==0
224                     'sources/': [
225                         ['exclude', 'default/WebRenderTheme.cpp'],
226                     ],
227                 }],
228             ],
229             'direct_dependent_settings': {
230                 'include_dirs': [
231                     '../../',
232                 ],
233             },
234             'target_conditions': [
235                 ['OS=="android"', {
236                     'sources/': [
237                         ['include', '^linux/WebFontRendering\\.cpp$'],
238                         ['include', '^linux/WebFontRenderStyle\\.cpp$'],
239                     ],
240                 }],
241             ],
242         },
243         {
244             'target_name': 'webkit_test_support',
245             'conditions': [
246                 ['component=="shared_library"', {
247                     'type': 'none',
248                 }, {
249                     'type': 'static_library',
250                     'dependencies': [
251                         '../config.gyp:config',
252                         '../core/core.gyp:webcore_test_support',
253                         '../modules/modules.gyp:modules_test_support',
254                         '../wtf/wtf.gyp:wtf',
255                         '<(DEPTH)/skia/skia.gyp:skia',
256                     ],
257                     'include_dirs': [
258                         '../../public/web',
259                         '../core/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
260                         '../../',
261                     ],
262                     'sources': [
263                         'WebTestingSupport.cpp',
264                     ],
265                 }],
266             ],
267         },
268         {
269             'target_name': 'picker_resources',
270             'type': 'none',
271             'hard_dependency': 1,
272             'variables': {
273                 'make_file_arrays': 'scripts/make-file-arrays.py',
274             },
275             'actions': [
276                 {
277                     'action_name': 'PickerCommon',
278                     'variables': {
279                         'resources': [
280                             'resources/pickerCommon.css',
281                             'resources/pickerCommon.js',
282                         ],
283                     },
284                     'inputs': [
285                         '<(make_file_arrays)',
286                         '<@(resources)',
287                     ],
288                     'outputs': [
289                         '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
290                         '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
291                         ],
292                     'action': [
293                         'python',
294                         '<(make_file_arrays)',
295                         '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
296                         '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
297                         '<@(resources)',
298                     ],
299                 },
300                 {
301                     'action_name': 'CalendarPicker',
302                     'variables': {
303                         'resources': [
304                             'resources/calendarPicker.css',
305                             'resources/calendarPicker.js',
306                             'resources/pickerButton.css',
307                             'resources/suggestionPicker.css',
308                             'resources/suggestionPicker.js',
309                         ],
310                     },
311                     'inputs': [
312                         '<(make_file_arrays)',
313                         '<@(resources)'
314                     ],
315                     'outputs': [
316                         '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
317                         '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
318                     ],
319                     'action': [
320                         'python',
321                         '<(make_file_arrays)',
322                         '--condition=ENABLE(CALENDAR_PICKER)',
323                         '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
324                         '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
325                         '<@(resources)',
326                     ],
327                },
328                 {
329                     'action_name': 'ColorSuggestionPicker',
330                     'variables': {
331                         'resources': [
332                             'resources/colorSuggestionPicker.css',
333                             'resources/colorSuggestionPicker.js',
334                         ],
335                     },
336                     'inputs': [
337                         '<(make_file_arrays)',
338                         '<@(resources)',
339                     ],
340                     'outputs': [
341                         '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
342                         '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
343                     ],
344                     'action': [
345                         'python',
346                         '<(make_file_arrays)',
347                         '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
348                         '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
349                         '<@(resources)',
350                     ],
351                 },
352             ],
353         },
354     ], # targets
355     'conditions': [
356         ['gcc_version>=46', {
357             'target_defaults': {
358                 # Disable warnings about c++0x compatibility, as some names (such
359                 # as nullptr) conflict with upcoming c++0x types.
360                 'cflags_cc': ['-Wno-c++0x-compat'],
361             },
362         }],
363         ['OS=="mac"', {
364             'targets': [
365                 {
366                     'target_name': 'copy_mesa',
367                     'type': 'none',
368                     'dependencies': ['<(DEPTH)/third_party/mesa/mesa.gyp:osmesa'],
369                     'copies': [{
370                         'destination': '<(PRODUCT_DIR)/DumpRenderTree.app/Contents/MacOS/',
371                         'files': ['<(PRODUCT_DIR)/osmesa.so'],
372                     }],
373                 },
374             ],
375         }],
376         ['clang==1', {
377             'target_defaults': {
378                 'cflags': ['-Wglobal-constructors'],
379                 'xcode_settings': {
380                     'WARNING_CFLAGS': ['-Wglobal-constructors'],
381                 },
382             },
383         }],
384     ], # conditions
385 }