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_publicheader_files)', 110 '<@(javascriptcore_privateheader_files)', 111 '<@(javascriptcore_files)', 112 ], 113 'sources/': [ 114 # First exclude everything ... 115 ['exclude', '../'], 116 # ... Then include what we want. 117 ['include', '../wtf/'], 118 # FIXME: This is clearly not sustainable. 119 ['exclude', '../wtf/android'], 120 ['exclude', '../wtf/brew'], 121 ['exclude', '../wtf/efl'], 122 ['exclude', '../wtf/gobject'], 123 ['exclude', '../wtf/gtk'], 124 ['exclude', '../wtf/haiku'], 125 ['exclude', '../wtf/mac'], 126 ['exclude', '../wtf/qt'], 127 ['exclude', '../wtf/url'], 128 ['exclude', '../wtf/wince'], 129 ['exclude', '../wtf/wx'], 130 ['exclude', '../wtf/unicode/brew'], 131 ['exclude', '../wtf/unicode/wince'], 132 ['exclude', '../wtf/unicode/glib'], 133 ['exclude', '../wtf/unicode/qt4'], 134 # GLib/GTK, even though its name doesn't really indicate. 135 ['exclude', '/(gtk|glib|gobject)/.*\\.(cpp|h)$'], 136 ['exclude', '(Default|Gtk|Mac|None|Qt|Win|Wx|Efl|Symbian)\\.(cpp|mm)$'], 137 ['exclude', 'wtf/CurrentTime\\.cpp$'], 138 ['exclude', 'wtf/OSRandomSource\\.cpp$'], 139 ['exclude', 'wtf/MainThread.cpp$'], 140 ['exclude', 'wtf/TC.*\\.(cpp|h)$'], 141 ], 142 'direct_dependent_settings': { 143 'include_dirs': [ 144 '../', 145 '../wtf', 146 ], 147 # Some warnings occur in JSC headers, so they must also be disabled 148 # in targets that use JSC. 149 'msvs_disabled_warnings': [ 150 # Don't complain about calling specific versions of templatized 151 # functions (e.g. in RefPtrHashMap.h). 152 4344, 153 # Don't complain about using "this" in an initializer list 154 # (e.g. in StringImpl.h). 155 4355, 156 ], 157 }, 158 'export_dependent_settings': [ 159 'wtf_config', 160 '<(chromium_src_dir)/third_party/icu/icu.gyp:icui18n', 161 '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc', 162 ], 163 'msvs_disabled_warnings': [4127, 4355, 4510, 4512, 4610, 4706], 164 'conditions': [ 165 ['OS=="win"', { 166 'sources/': [ 167 ['exclude', 'ThreadIdentifierDataPthreads\\.(h|cpp)$'], 168 ['exclude', 'ThreadingPthreads\\.cpp$'], 169 ['include', 'Thread(ing|Specific)Win\\.cpp$'], 170 ['exclude', 'OSAllocatorPosix\\.cpp$'], 171 ['include', 'OSAllocatorWin\\.cpp$'] 172 ], 173 'include_dirs!': [ 174 '<(SHARED_INTERMEDIATE_DIR)/webkit', 175 ], 176 'conditions': [ 177 ['inside_chromium_build==1 and component=="shared_library"', { 178 # Chromium windows multi-dll build enables c++ exception and this 179 # causes wtf generates 4291 warning due to operator new/delete 180 # implementations. Disable the warning for chromium windows 181 # multi-dll build. 182 'msvs_disabled_warnings': [4291], 183 'direct_dependent_settings': { 184 'msvs_disabled_warnings': [4291], 185 }, 186 }], 187 ], 188 }], 189 ], 190 }, 191 { 192 'target_name': 'yarr', 193 'type': '<(library)', 194 'dependencies': [ 195 'wtf', 196 ], 197 'conditions': [ 198 ['OS=="win"', { 199 'dependencies': ['<(chromium_src_dir)/build/win/system.gyp:cygwin'], 200 }], 201 ], 202 'msvs_guid': '49909552-0B0C-4C14-8CF6-DB8A2ADE0934', 203 'actions': [ 204 { 205 'action_name': 'retgen', 206 'inputs': [ 207 '../create_regex_tables', 208 ], 209 'arguments': [ 210 '--no-tables', 211 ], 212 'outputs': [ 213 '<(INTERMEDIATE_DIR)/RegExpJitTables.h', 214 ], 215 'action': ['python', '<@(_inputs)', '<@(_arguments)', '<@(_outputs)'], 216 }, 217 ], 218 'include_dirs': [ 219 '<(INTERMEDIATE_DIR)', 220 '../runtime', 221 ], 222 'sources': [ 223 '<@(javascriptcore_files)', 224 ], 225 'sources/': [ 226 # First exclude everything ... 227 ['exclude', '../'], 228 # ... Then include what we want. 229 ['include', '../yarr/'], 230 # The Yarr JIT isn't used in WebCore. 231 ['exclude', '../yarr/YarrJIT\\.(h|cpp)$'], 232 ], 233 'export_dependent_settings': [ 234 'wtf', 235 ], 236 }, 237 ], # targets 238} 239