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         '../platform/blink_platform.gypi',
     40         '../wtf/wtf.gypi',
     41         'web.gypi',
     42     ],
     43     'targets': [
     44         {
     45             'target_name': 'blink_web',
     46             'type': '<(component)',
     47             'variables': { 'enable_wexit_time_destructors': 1, },
     48             'dependencies': [
     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                 '<(angle_path)/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                 '<(angle_path)/include',
     67                 '<(DEPTH)/third_party/skia/include/utils',
     68             ],
     69             'defines': [
     70                 'BLINK_IMPLEMENTATION=1',
     71                 'INSIDE_BLINK',
     72             ],
     73             'sources': [
     74                 '<@(web_files)',
     75             ],
     76             'conditions': [
     77                 ['component=="shared_library"', {
     78                     'dependencies': [
     79                         '../core/core.gyp:webcore_generated',
     80                         '../core/core.gyp:webcore_testing',
     81                         '../modules/modules.gyp:modules_testing',
     82                         '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
     83                         '<(DEPTH)/base/base.gyp:test_support_base',
     84                         '<(DEPTH)/testing/gmock.gyp:gmock',
     85                         '<(DEPTH)/testing/gtest.gyp:gtest',
     86                         '<(DEPTH)/third_party/icu/icu.gyp:icuuc',
     87                         '<(DEPTH)/third_party/icu/icu.gyp:icui18n',
     88                         '<(DEPTH)/third_party/libpng/libpng.gyp:libpng',
     89                         '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
     90                         '<(DEPTH)/third_party/libxml/libxml.gyp:libxml',
     91                         '<(DEPTH)/third_party/libxslt/libxslt.gyp:libxslt',
     92                         '<(DEPTH)/third_party/modp_b64/modp_b64.gyp:modp_b64',
     93                         '<(DEPTH)/third_party/ots/ots.gyp:ots',
     94                         '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
     95                         '<(DEPTH)/url/url.gyp:url_lib',
     96                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
     97                         '<(libjpeg_gyp_path):libjpeg',
     98                         # We must not add webkit_support here because of cyclic dependency.
     99                     ],
    100                     'export_dependent_settings': [
    101                         '<(DEPTH)/url/url.gyp:url_lib',
    102                         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
    103                     ],
    104                     'sources': [
    105                         # Compile Blink unittest files into blink_web.dll in component build mode
    106                         # since there're methods that are tested but not exported.
    107                         # WebUnitTests.* exports an API that runs all the unittests inside
    108                         # blink_web.dll.
    109                         '<@(bindings_unittest_files)',
    110                         '<@(core_unittest_files)',
    111                         '<@(modules_unittest_files)',
    112                         # FIXME: the next line should not be needed. We prefer to run these unit tests outside blink_web.dll.
    113                         '<@(platform_web_unittest_files)',
    114                         '<@(web_unittest_files)',
    115                         'WebTestingSupport.cpp',
    116                         'tests/WebUnitTests.cpp',   # Components test runner support.
    117                     ],
    118                     'conditions': [
    119                         ['OS=="win" or OS=="mac"', {
    120                             'dependencies': [
    121                                 '<(DEPTH)/third_party/nss/nss.gyp:*',
    122                             ],
    123                         }],
    124                         ['clang==1', {
    125                             # FIXME: It would be nice to enable this in shared builds too,
    126                             # but the test files have global constructors from the GTEST macro
    127                             # and we pull in the test files into the blink_web target in the
    128                             # shared build.
    129                             'cflags!': ['-Wglobal-constructors'],
    130                             'xcode_settings': {
    131                               'WARNING_CFLAGS!': ['-Wglobal-constructors'],
    132                             },
    133                         }],
    134                     ],
    135                     'msvs_settings': {
    136                       'VCLinkerTool': {
    137                         'conditions': [
    138                           ['incremental_chrome_dll==1', {
    139                             'UseLibraryDependencyInputs': "true",
    140                           }],
    141                         ],
    142                       },
    143                     },
    144                 }],
    145                 ['OS == "linux"', {
    146                     'dependencies': [
    147                         '<(DEPTH)/build/linux/system.gyp:fontconfig',
    148                     ],
    149                 }, {
    150                     'sources/': [
    151                         ['exclude', 'linux/'],
    152                     ],
    153                 }],
    154                 ['use_x11 == 1', {
    155                     'dependencies': [
    156                         '<(DEPTH)/build/linux/system.gyp:x11',
    157                     ],
    158                 }, {
    159                     'sources/': [
    160                         ['exclude', 'x11/'],
    161                     ]
    162                 }],
    163                 ['OS!="android"', {
    164                     'sources/': [
    165                         ['exclude', 'WebInputEventFactoryAndroid.cpp$'],
    166                     ],
    167                 }],
    168                 ['OS=="mac"', {
    169                     'link_settings': {
    170                         'libraries': [
    171                             '$(SDKROOT)/System/Library/Frameworks/Accelerate.framework',
    172                             '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
    173                         ],
    174                     },
    175                 }, { # else: OS!="mac"
    176                     'sources/': [
    177                         ['exclude', 'WebInputEventFactoryMac.mm$'],
    178                         ['exclude', 'mac/WebScrollbarTheme.cpp$'],
    179                     ],
    180                 }],
    181                 ['OS!="win"', {
    182                     'sources/': [
    183                         ['exclude', 'WebInputEventFactoryWin.cpp$'],
    184                     ],
    185                 }],
    186                 ['use_default_render_theme==0', {
    187                     'sources/': [
    188                         ['exclude', 'default/WebRenderTheme.cpp'],
    189                     ],
    190                 }],
    191             ],
    192             'direct_dependent_settings': {
    193                 'include_dirs': [
    194                     '../../',
    195                 ],
    196             },
    197             'target_conditions': [
    198                 ['OS=="android"', {
    199                     'sources/': [
    200                         ['include', '^linux/WebFontRendering\\.cpp$'],
    201                     ],
    202                 }],
    203             ],
    204             'actions': [
    205                 {
    206                     'action_name': 'PickerCommon',
    207                     'process_outputs_as_sources': 1,
    208                     'variables': {
    209                         'resources': [
    210                             'resources/pickerCommon.css',
    211                             'resources/pickerCommon.js',
    212                         ],
    213                     },
    214                     'inputs': [
    215                         '../build/scripts/make-file-arrays.py',
    216                         '<@(resources)',
    217                     ],
    218                     'outputs': [
    219                         '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
    220                         '<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
    221                         ],
    222                     'action': [
    223                         'python',
    224                         '../build/scripts/make-file-arrays.py',
    225                         '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.h',
    226                         '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/PickerCommon.cpp',
    227                         '<@(resources)',
    228                     ],
    229                 },
    230                 {
    231                     'action_name': 'CalendarPicker',
    232                     'process_outputs_as_sources': 1,
    233                     'variables': {
    234                         'resources': [
    235                             'resources/calendarPicker.css',
    236                             'resources/calendarPicker.js',
    237                             'resources/pickerButton.css',
    238                             'resources/suggestionPicker.css',
    239                             'resources/suggestionPicker.js',
    240                         ],
    241                     },
    242                     'inputs': [
    243                         '../build/scripts/make-file-arrays.py',
    244                         '<@(resources)'
    245                     ],
    246                     'outputs': [
    247                         '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
    248                         '<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
    249                     ],
    250                     'action': [
    251                         'python',
    252                         '../build/scripts/make-file-arrays.py',
    253                         '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.h',
    254                         '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/CalendarPicker.cpp',
    255                         '<@(resources)',
    256                     ],
    257                },
    258                 {
    259                     'action_name': 'ColorSuggestionPicker',
    260                     'process_outputs_as_sources': 1,
    261                     'variables': {
    262                         'resources': [
    263                             'resources/colorSuggestionPicker.css',
    264                             'resources/colorSuggestionPicker.js',
    265                         ],
    266                     },
    267                     'inputs': [
    268                         '../build/scripts/make-file-arrays.py',
    269                         '<@(resources)',
    270                     ],
    271                     'outputs': [
    272                         '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
    273                         '<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
    274                     ],
    275                     'action': [
    276                         'python',
    277                         '../build/scripts/make-file-arrays.py',
    278                         '--out-h=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.h',
    279                         '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/blink/ColorSuggestionPicker.cpp',
    280                         '<@(resources)',
    281                     ],
    282                 },
    283             ],
    284         },
    285         {
    286             'target_name': 'blink_web_test_support',
    287             'conditions': [
    288                 ['component=="shared_library"', {
    289                     'type': 'none',
    290                 }, {
    291                     'type': 'static_library',
    292                     'dependencies': [
    293                         '../config.gyp:config',
    294                         '../core/core.gyp:webcore_testing',
    295                         '../modules/modules.gyp:modules_testing',
    296                         '../wtf/wtf.gyp:wtf',
    297                         '<(DEPTH)/skia/skia.gyp:skia',
    298                     ],
    299                     'include_dirs': [
    300                         '../../',
    301                     ],
    302                     'sources': [
    303                         'WebTestingSupport.cpp',
    304                     ],
    305                 }],
    306             ],
    307         },
    308     ], # targets
    309     'conditions': [
    310         ['gcc_version>=46', {
    311             'target_defaults': {
    312                 # Disable warnings about c++0x compatibility, as some names (such
    313                 # as nullptr) conflict with upcoming c++0x types.
    314                 'cflags_cc': ['-Wno-c++0x-compat'],
    315             },
    316         }],
    317         ['OS=="mac"', {
    318             'targets': [
    319                 {
    320                     'target_name': 'copy_mesa',
    321                     'type': 'none',
    322                     'dependencies': ['<(DEPTH)/third_party/mesa/mesa.gyp:osmesa'],
    323                     'copies': [{
    324                         'destination': '<(PRODUCT_DIR)/DumpRenderTree.app/Contents/MacOS/',
    325                         'files': ['<(PRODUCT_DIR)/osmesa.so'],
    326                     }],
    327                 },
    328             ],
    329         }],
    330         ['clang==1', {
    331             'target_defaults': {
    332                 'cflags': ['-Wglobal-constructors'],
    333                 'xcode_settings': {
    334                     'WARNING_CFLAGS': ['-Wglobal-constructors'],
    335                 },
    336             },
    337         }],
    338     ], # conditions
    339 }
    340