Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 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': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 33 | '../bindings/bindings.gypi', |
Torne (Richard Coles) | 1e20218 | 2013-10-18 15:46:42 +0100 | [diff] [blame] | 34 | '../build/features.gypi', |
Torne (Richard Coles) | f79f16f | 2013-10-31 11:16:44 +0000 | [diff] [blame] | 35 | '../build/scripts/scripts.gypi', |
| 36 | '../core/core.gypi', |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 37 | '../modules/modules.gypi', |
Torne (Richard Coles) | 0938029 | 2014-02-21 12:17:33 +0000 | [diff] [blame] | 38 | '../platform/blink_platform.gypi', |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 39 | '../web/web.gypi', |
| 40 | '../wtf/wtf.gypi', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 41 | ], |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 42 | 'targets': [ |
| 43 | { |
Torne (Richard Coles) | a854de0 | 2013-12-18 16:25:25 +0000 | [diff] [blame] | 44 | 'target_name': 'webkit_unit_tests_resources', |
| 45 | 'type': 'none', |
| 46 | 'dependencies': [ |
| 47 | '<(DEPTH)/net/net.gyp:net_resources', |
| 48 | '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources', |
| 49 | '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources', |
| 50 | '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings', |
| 51 | ], |
| 52 | 'actions': [{ |
| 53 | 'action_name': 'repack_webkit_unit_tests_resources', |
| 54 | 'variables': { |
| 55 | 'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py', |
| 56 | 'pak_inputs': [ |
| 57 | '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', |
| 58 | '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak', |
| 59 | '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak', |
| 60 | '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak', |
| 61 | '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak', |
| 62 | ]}, |
| 63 | 'inputs': [ |
| 64 | '<(repack_path)', |
| 65 | '<@(pak_inputs)', |
| 66 | ], |
| 67 | 'outputs': [ |
| 68 | '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak', |
| 69 | ], |
| 70 | 'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'], |
| 71 | }], |
| 72 | 'conditions': [ |
| 73 | ['OS=="mac"', { |
| 74 | 'all_dependent_settings': { |
| 75 | 'mac_bundle_resources': [ |
| 76 | '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak', |
| 77 | ], |
| 78 | }, |
| 79 | }], |
| 80 | ] |
| 81 | }, |
| 82 | { |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 83 | 'target_name': 'webkit_unit_tests', |
| 84 | 'type': 'executable', |
| 85 | 'variables': { 'enable_wexit_time_destructors': 1, }, |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 86 | 'dependencies': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 87 | '../../public/blink.gyp:blink', |
Torne (Richard Coles) | a854de0 | 2013-12-18 16:25:25 +0000 | [diff] [blame] | 88 | '../wtf/wtf_tests.gyp:wtf_unittest_helpers', |
Torne (Richard Coles) | 0938029 | 2014-02-21 12:17:33 +0000 | [diff] [blame] | 89 | 'web.gyp:webkit_test_support', |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 90 | '<(DEPTH)/base/base.gyp:base', |
| 91 | '<(DEPTH)/base/base.gyp:base_i18n', |
| 92 | '<(DEPTH)/base/base.gyp:test_support_base', |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 93 | '<(DEPTH)/testing/gmock.gyp:gmock', |
| 94 | '<(DEPTH)/testing/gtest.gyp:gtest', |
Ben Murdoch | 591b958 | 2013-07-10 11:41:44 +0100 | [diff] [blame] | 95 | '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp', |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 96 | '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', |
Torne (Richard Coles) | 521d96e | 2013-06-19 11:58:24 +0100 | [diff] [blame] | 97 | '<(DEPTH)/url/url.gyp:url_lib', |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 98 | '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', |
Torne (Richard Coles) | bfe3590 | 2013-10-22 16:41:51 +0100 | [diff] [blame] | 99 | '<(DEPTH)/content/content_shell_and_tests.gyp:content_webkit_unit_test_support', |
Torne (Richard Coles) | a854de0 | 2013-12-18 16:25:25 +0000 | [diff] [blame] | 100 | 'webkit_unit_tests_resources', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 101 | ], |
| 102 | 'sources': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 103 | '../web/tests/RunAllTests.cpp', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 104 | ], |
| 105 | 'include_dirs': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 106 | '../../public/web', |
| 107 | '../web', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 108 | 'src', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 109 | ], |
| 110 | 'conditions': [ |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 111 | ['component=="shared_library"', { |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 112 | 'defines': [ |
Torne (Richard Coles) | 1e20218 | 2013-10-18 15:46:42 +0100 | [diff] [blame] | 113 | 'BLINK_DLL_UNITTEST', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 114 | ], |
| 115 | }, { |
| 116 | 'dependencies': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 117 | '../core/core.gyp:webcore', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 118 | ], |
| 119 | 'defines': [ |
Torne (Richard Coles) | 06f816c | 2013-09-26 13:25:12 +0100 | [diff] [blame] | 120 | 'BLINK_IMPLEMENTATION=1', |
Torne (Richard Coles) | 1e20218 | 2013-10-18 15:46:42 +0100 | [diff] [blame] | 121 | 'INSIDE_BLINK', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 122 | ], |
| 123 | 'sources': [ |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 124 | '<@(bindings_unittest_files)', |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 125 | '<@(core_unittest_files)', |
Torne (Richard Coles) | 5267f70 | 2013-06-11 10:57:24 +0100 | [diff] [blame] | 126 | '<@(modules_unittest_files)', |
Torne (Richard Coles) | 0938029 | 2014-02-21 12:17:33 +0000 | [diff] [blame] | 127 | '<@(platform_web_unittest_files)', |
Ben Murdoch | e69819b | 2013-07-17 14:56:49 +0100 | [diff] [blame] | 128 | '<@(web_unittest_files)', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 129 | ], |
| 130 | 'conditions': [ |
| 131 | ['toolkit_uses_gtk == 1', { |
| 132 | 'include_dirs': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 133 | '../../public/web/gtk', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 134 | ], |
| 135 | 'variables': { |
| 136 | # FIXME: Enable warnings on other platforms. |
| 137 | 'chromium_code': 1, |
| 138 | }, |
| 139 | }], |
| 140 | ], |
| 141 | }], |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 142 | ['OS=="win" and component!="shared_library"', { |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 143 | 'configurations': { |
| 144 | 'Debug_Base': { |
| 145 | 'msvs_settings': { |
| 146 | 'VCLinkerTool': { |
| 147 | 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', |
| 148 | }, |
| 149 | }, |
| 150 | }, |
| 151 | }, |
Torne (Richard Coles) | 51b2906 | 2013-11-28 11:56:03 +0000 | [diff] [blame] | 152 | 'conditions': [ |
| 153 | ['win_use_allocator_shim==1', { |
| 154 | 'dependencies': [ |
| 155 | '<(DEPTH)/base/allocator/allocator.gyp:allocator', |
| 156 | ], |
| 157 | }], |
| 158 | ], |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 159 | }], |
| 160 | ['OS=="android" and gtest_target_type == "shared_library"', { |
| 161 | 'type': 'shared_library', |
| 162 | 'dependencies': [ |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 163 | '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', |
| 164 | '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 165 | ], |
| 166 | }], |
| 167 | ['OS=="mac"', { |
| 168 | 'include_dirs': [ |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 169 | '../../public/web/mac', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 170 | ], |
| 171 | }], |
Torne (Richard Coles) | d5428f3 | 2014-03-18 10:21:16 +0000 | [diff] [blame] | 172 | # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554 |
| 173 | [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1))', { |
Torne (Richard Coles) | 926b001 | 2013-03-28 15:32:48 +0000 | [diff] [blame] | 174 | 'dependencies': [ |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 175 | '<(DEPTH)/base/allocator/allocator.gyp:allocator', |
Torne (Richard Coles) | 926b001 | 2013-03-28 15:32:48 +0000 | [diff] [blame] | 176 | ], |
| 177 | }], |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 178 | ], |
Ben Murdoch | fff8884 | 2013-07-30 15:20:09 +0100 | [diff] [blame] | 179 | } |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 180 | ], # targets |
| 181 | 'conditions': [ |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 182 | ['gcc_version>=46', { |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 183 | 'target_defaults': { |
| 184 | # Disable warnings about c++0x compatibility, as some names (such |
| 185 | # as nullptr) conflict with upcoming c++0x types. |
| 186 | 'cflags_cc': ['-Wno-c++0x-compat'], |
| 187 | }, |
| 188 | }], |
Torne (Richard Coles) | 926b001 | 2013-03-28 15:32:48 +0000 | [diff] [blame] | 189 | ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', { |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 190 | # Wrap libwebkit_unit_tests.so into an android apk for execution. |
| 191 | 'targets': [{ |
| 192 | 'target_name': 'webkit_unit_tests_apk', |
| 193 | 'type': 'none', |
| 194 | 'dependencies': [ |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 195 | '<(DEPTH)/base/base.gyp:base_java', |
| 196 | '<(DEPTH)/net/net.gyp:net_java', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 197 | 'webkit_unit_tests', |
| 198 | ], |
| 199 | 'variables': { |
Torne (Richard Coles) | 53e740f | 2013-05-09 18:38:43 +0100 | [diff] [blame] | 200 | 'test_suite_name': 'webkit_unit_tests', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 201 | 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)', |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 202 | }, |
Torne (Richard Coles) | f5e4ad5 | 2013-08-05 13:57:57 +0100 | [diff] [blame] | 203 | 'includes': [ '../../../../build/apk_test.gypi' ], |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 204 | }], |
| 205 | }], |
Torne (Richard Coles) | 5c87bf8 | 2012-11-14 11:46:17 +0000 | [diff] [blame] | 206 | ], |
| 207 | } |