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