1 # Copyright (C) 2012 Google Inc. All rights reserved. 2 # 3 # Redistribution and use in source and binary forms, with or without 4 # modification, are permitted provided that the following conditions are 5 # met: 6 # 7 # * Redistributions of source code must retain the above copyright 8 # notice, this list of conditions and the following disclaimer. 9 # * Redistributions in binary form must reproduce the above 10 # copyright notice, this list of conditions and the following disclaimer 11 # in the documentation and/or other materials provided with the 12 # distribution. 13 # * Neither the name of Google Inc. nor the names of its 14 # contributors may be used to endorse or promote products derived from 15 # this software without specific prior written permission. 16 # 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 { 29 'includes': [ 30 '../build/win/precompile.gypi', 31 '../core/features.gypi', 32 'wtf.gypi', 33 ], 34 'conditions': [ 35 ['gcc_version>=46', { 36 'target_defaults': { 37 # Disable warnings about c++0x compatibility, as some names (such as nullptr) conflict 38 # with upcoming c++0x types. 39 'cflags_cc': ['-Wno-c++0x-compat'], 40 }, 41 }], 42 ], 43 'targets': [ 44 { 45 # This target sets up defines and includes that are required by WTF and 46 # its dependents. 47 'target_name': 'wtf_config', 48 'type': 'none', 49 'direct_dependent_settings': { 50 'defines': [ 51 # Import features_defines from features.gypi 52 '<@(feature_defines)', 53 ], 54 'conditions': [ 55 ['OS=="win"', { 56 'defines': [ 57 '__STD_C', 58 '_CRT_SECURE_NO_DEPRECATE', 59 '_SCL_SECURE_NO_DEPRECATE', 60 'CRASH=__debugbreak', 61 ], 62 'include_dirs': [ 63 'os-win32', 64 ], 65 }], 66 # FIXME: This should go in a header, not in the GYP file. 67 ['OS=="mac"', { 68 'defines': [ 69 'WTF_USE_NEW_THEME=1', 70 ], 71 }], 72 ], 73 }, 74 }, 75 { 76 'target_name': 'wtf', 77 'type': '<(component)', 78 'include_dirs': [ 79 '..', 80 ], 81 'dependencies': [ 82 'wtf_config', 83 '<(DEPTH)/third_party/icu/icu.gyp:icui18n', 84 '<(DEPTH)/third_party/icu/icu.gyp:icuuc', 85 ], 86 'sources': [ 87 '<@(wtf_files)', 88 ], 89 'defines': [ 90 'WTF_IMPLEMENTATION=1', 91 ], 92 'direct_dependent_settings': { 93 'include_dirs': [ 94 '..', 95 ], 96 # Some warnings occur in WTF headers, so they must also be disabled 97 # in targets that use WTF. 98 'msvs_disabled_warnings': [ 99 # Don't complain about calling specific versions of templatized 100 # functions (e.g. in RefPtrHashMap.h). 101 4344, 102 # Don't complain about using "this" in an initializer list 103 # (e.g. in StringImpl.h). 104 4355, 105 # Disable c4267 warnings until we fix size_t to int truncations. 106 4267, 107 ], 108 }, 109 'export_dependent_settings': [ 110 'wtf_config', 111 '<(DEPTH)/third_party/icu/icu.gyp:icui18n', 112 '<(DEPTH)/third_party/icu/icu.gyp:icuuc', 113 ], 114 # Disable c4267 warnings until we fix size_t to int truncations. 115 'msvs_disabled_warnings': [4127, 4355, 4510, 4512, 4610, 4706, 4068, 4267], 116 'conditions': [ 117 ['OS=="android"', { 118 'link_settings': { 119 'libraries': [ 120 '-llog', 121 ] 122 } 123 }], 124 ['OS=="win"', { 125 'sources/': [ 126 ['exclude', 'ThreadIdentifierDataPthreads\\.(h|cpp)$'], 127 ['exclude', 'ThreadingPthreads\\.cpp$'], 128 ], 129 'include_dirs!': [ 130 '<(SHARED_INTERMEDIATE_DIR)/blink', 131 ], 132 'conditions': [ 133 ['component=="shared_library"', { 134 # Chromium windows multi-dll build enables c++ exception and this 135 # causes wtf generates 4291 warning due to operator new/delete 136 # implementations. Disable the warning for chromium windows 137 # multi-dll build. 138 'msvs_disabled_warnings': [4291], 139 'direct_dependent_settings': { 140 'msvs_disabled_warnings': [4291], 141 }, 142 }], 143 ], 144 }, { # OS!="win" 145 'sources/': [ 146 ['exclude', 'Win\\.cpp$'], 147 ], 148 }], 149 ['OS=="mac"', { 150 'link_settings': { 151 'libraries': [ 152 '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', 153 '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', 154 ] 155 } 156 }, { # OS!="mac" 157 'sources/': [ 158 ['exclude', 'Mac\\.mm$'], 159 # mac is the only OS that uses WebKit's copy of TCMalloc. 160 ['exclude', 'TC.*\\.(cpp|h)$'], 161 ], 162 }], 163 ], 164 }, 165 ] 166 } 167