| OLD | NEW |
| (Empty) |
| 1 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 Import('env') | |
| 6 | |
| 7 env_res = env.Clone() | |
| 8 env_tests = env.Clone() | |
| 9 env = env.Clone() | |
| 10 | |
| 11 env.Prepend( | |
| 12 CPPPATH = [ | |
| 13 '$ZLIB_DIR', | |
| 14 '$ICU38_DIR/public/common', | |
| 15 '$ICU38_DIR/public/i18n', | |
| 16 '$SDCH_DIR/open-vcdiff/src', | |
| 17 '..', | |
| 18 ], | |
| 19 ) | |
| 20 | |
| 21 env.Append( | |
| 22 CPPDEFINES = [ | |
| 23 'U_STATIC_IMPLEMENTATION', | |
| 24 ], | |
| 25 ) | |
| 26 | |
| 27 # These net files work on *all* platforms; files that don't work | |
| 28 # cross-platform live below. | |
| 29 input_files = [ | |
| 30 'base/address_list.cc', | |
| 31 'base/auth_cache.cc', | |
| 32 'base/base64.cc', | |
| 33 'base/bzip2_filter.cc', | |
| 34 'base/client_socket_handle.cc', | |
| 35 'base/client_socket_pool.cc', | |
| 36 'base/cookie_monster.cc', | |
| 37 'base/cookie_policy.cc', | |
| 38 'base/data_url.cc', | |
| 39 'base/escape.cc', | |
| 40 'base/ev_root_ca_metadata.cc', | |
| 41 'base/filter.cc', | |
| 42 'base/gzip_filter.cc', | |
| 43 'base/gzip_header.cc', | |
| 44 'base/host_resolver.cc', | |
| 45 'base/mime_sniffer.cc', | |
| 46 'base/mime_util.cc', | |
| 47 'base/net_errors.cc', | |
| 48 'base/net_module.cc', | |
| 49 'base/net_util.cc', | |
| 50 'base/registry_controlled_domain.cc', | |
| 51 'base/sdch_filter.cc', | |
| 52 'base/sdch_manager.cc', | |
| 53 'base/upload_data.cc', | |
| 54 'base/x509_certificate.cc', | |
| 55 'disk_cache/backend_impl.cc', | |
| 56 'disk_cache/block_files.cc', | |
| 57 'disk_cache/entry_impl.cc', | |
| 58 'disk_cache/file_lock.cc', | |
| 59 'disk_cache/hash.cc', | |
| 60 'disk_cache/mem_backend_impl.cc', | |
| 61 'disk_cache/mem_entry_impl.cc', | |
| 62 'disk_cache/mem_rankings.cc', | |
| 63 'disk_cache/rankings.cc', | |
| 64 'disk_cache/stats.cc', | |
| 65 'disk_cache/stats_histogram.cc', | |
| 66 'disk_cache/trace.cc', | |
| 67 'http/cert_status_cache.cc', | |
| 68 'http/http_auth.cc', | |
| 69 'http/http_auth_handler.cc', | |
| 70 'http/http_auth_handler_basic.cc', | |
| 71 'http/http_auth_handler_digest.cc', | |
| 72 'http/http_cache.cc', | |
| 73 'http/http_chunked_decoder.cc', | |
| 74 'http/http_response_headers.cc', | |
| 75 'http/http_util.cc', | |
| 76 'http/http_vary_data.cc', | |
| 77 'url_request/mime_sniffer_proxy.cc', | |
| 78 'url_request/url_request.cc', | |
| 79 'url_request/url_request_about_job.cc', | |
| 80 'url_request/url_request_error_job.cc', | |
| 81 'url_request/url_request_file_job.cc', | |
| 82 'url_request/url_request_http_job.cc', | |
| 83 'url_request/url_request_job.cc', | |
| 84 'url_request/url_request_job_metrics.cc', | |
| 85 'url_request/url_request_job_tracker.cc', | |
| 86 'url_request/url_request_simple_job.cc', | |
| 87 'url_request/url_request_test_job.cc', | |
| 88 'url_request/url_request_view_cache_job.cc', | |
| 89 ] | |
| 90 | |
| 91 if env['PLATFORM'] == 'win32': | |
| 92 input_files.extend([ | |
| 93 'base/client_socket_factory.cc', | |
| 94 'base/directory_lister.cc', | |
| 95 'base/dns_resolution_observer.cc', | |
| 96 'base/listen_socket.cc', | |
| 97 'base/ssl_client_socket_win.cc', | |
| 98 'base/ssl_config_service.cc', | |
| 99 'base/tcp_client_socket.cc', | |
| 100 'base/telnet_server.cc', | |
| 101 'base/upload_data_stream.cc', | |
| 102 'base/wininet_util.cc', | |
| 103 'base/winsock_init.cc', | |
| 104 'http/http_network_layer.cc', | |
| 105 'http/http_network_transaction.cc', | |
| 106 'http/http_transaction_winhttp.cc', | |
| 107 'http/winhttp_request_throttle.cc', | |
| 108 'proxy/proxy_resolver_fixed.cc', | |
| 109 'proxy/proxy_resolver_winhttp.cc', | |
| 110 'proxy/proxy_service.cc', | |
| 111 'url_request/url_request_file_dir_job.cc', | |
| 112 'url_request/url_request_filter.cc', | |
| 113 'url_request/url_request_ftp_job.cc', | |
| 114 'url_request/url_request_inet_job.cc', | |
| 115 'url_request/url_request_job_manager.cc', | |
| 116 ]) | |
| 117 | |
| 118 if env['PLATFORM'] == 'win32': | |
| 119 input_files.extend([ | |
| 120 'base/file_input_stream_win.cc', | |
| 121 'base/net_util_win.cc', | |
| 122 'base/platform_mime_util_win.cc', | |
| 123 'base/x509_certificate_win.cc', | |
| 124 'disk_cache/cache_util_win.cc', | |
| 125 'disk_cache/file_win.cc', | |
| 126 'disk_cache/mapped_file_win.cc', | |
| 127 'disk_cache/os_file_win.cc', | |
| 128 ]) | |
| 129 | |
| 130 if env['PLATFORM'] == 'darwin': | |
| 131 input_files.extend([ | |
| 132 'base/platform_mime_util_mac.mm', | |
| 133 'base/x509_certificate_mac.cc', | |
| 134 ]) | |
| 135 | |
| 136 if env['PLATFORM'] == 'posix': | |
| 137 input_files.extend([ | |
| 138 # TODO(tc): gnome-vfs? xdgmime? /etc/mime.types? | |
| 139 'base/platform_mime_util_linux.cc', | |
| 140 ]) | |
| 141 | |
| 142 if env['PLATFORM'] in ('darwin', 'posix'): | |
| 143 input_files.extend([ | |
| 144 'base/file_input_stream_posix.cc', | |
| 145 'base/net_util_posix.cc', | |
| 146 'base/tcp_client_socket_libevent.cc', | |
| 147 'disk_cache/cache_util_posix.cc', | |
| 148 'disk_cache/file_posix.cc', | |
| 149 'disk_cache/mapped_file_posix.cc', | |
| 150 'disk_cache/os_file_posix.cc', | |
| 151 ]) | |
| 152 | |
| 153 if env['PLATFORM'] == 'win32': | |
| 154 # TODO(bradnelson): This step generates file precompiled_net.pch.ib_tag | |
| 155 # possibly only on incredibuild, scons doesn't know this. | |
| 156 env_p = env.Clone() | |
| 157 env_p.Append(CCFLAGS='/Ylnet') | |
| 158 pch, obj = env_p.PCH('precompiled_net.pch', 'build/precompiled_net.cc') | |
| 159 env['PCH'] = pch | |
| 160 env['PCHSTOP'] = 'precompiled_net.h' | |
| 161 env.Append(CCPCHFLAGS = ['/FIprecompiled_net.h']) | |
| 162 input_files += [obj] | |
| 163 | |
| 164 env.ChromeStaticLibrary('net', input_files) | |
| 165 | |
| 166 | |
| 167 env_tests.Prepend( | |
| 168 CPPPATH = [ | |
| 169 '..', | |
| 170 ], | |
| 171 CPPDEFINES = [ | |
| 172 'UNIT_TEST', | |
| 173 ], | |
| 174 LIBS = [ # On Linux, dependencies must follow dependents, so... | |
| 175 'net', # net must come before base and modp_b64 | |
| 176 'bzip2', # bzip2 must come before base | |
| 177 'base', | |
| 178 'googleurl', | |
| 179 'gtest', | |
| 180 'sdch', | |
| 181 env_tests['ICU_LIBS'], # TODO(sgk): '$ICU_LIBS' when scons is fixed | |
| 182 'modp_b64', | |
| 183 'zlib', | |
| 184 ] | |
| 185 ) | |
| 186 | |
| 187 env_tests.Append( | |
| 188 CPPPATH = [ | |
| 189 '$GTEST_DIR/include', | |
| 190 ], | |
| 191 ) | |
| 192 | |
| 193 if env['PLATFORM'] == 'win32': | |
| 194 env_tests.Prepend( | |
| 195 CCFLAGS = [ | |
| 196 '/TP', | |
| 197 '/WX', | |
| 198 ], | |
| 199 CPPDEFINES = [ | |
| 200 '_WIN32_WINNT=0x0600', | |
| 201 'WINVER=0x0600', | |
| 202 '_HAS_EXCEPTIONS=0', | |
| 203 ], | |
| 204 LINKFLAGS = [ | |
| 205 '/DELAYLOAD:"dwmapi.dll"', | |
| 206 '/DELAYLOAD:"uxtheme.dll"', | |
| 207 '/MACHINE:X86', | |
| 208 '/FIXED:No', | |
| 209 '/safeseh', | |
| 210 '/dynamicbase', | |
| 211 '/ignore:4199', | |
| 212 '/nxcompat', | |
| 213 ], | |
| 214 ) | |
| 215 | |
| 216 if env['PLATFORM'] in ('posix', 'darwin'): | |
| 217 env_tests.Append( | |
| 218 LIBS = [ | |
| 219 'event', | |
| 220 ], | |
| 221 ) | |
| 222 | |
| 223 | |
| 224 unittest_files = [ | |
| 225 'base/auth_cache_unittest.cc', | |
| 226 'base/base64_unittest.cc', | |
| 227 'base/bzip2_filter_unittest.cc', | |
| 228 'base/client_socket_pool_unittest.cc', | |
| 229 'base/cookie_monster_unittest.cc', | |
| 230 'base/cookie_policy_unittest.cc', | |
| 231 'base/data_url_unittest.cc', | |
| 232 'base/escape_unittest.cc', | |
| 233 'base/file_input_stream_unittest.cc', | |
| 234 'base/gzip_filter_unittest.cc', | |
| 235 'base/host_resolver_unittest.cc', | |
| 236 'base/mime_sniffer_unittest.cc', | |
| 237 'base/mime_util_unittest.cc', | |
| 238 'base/net_util_unittest.cc', | |
| 239 'base/registry_controlled_domain_unittest.cc', | |
| 240 'base/run_all_unittests.cc', | |
| 241 'base/tcp_client_socket_unittest.cc', | |
| 242 'base/test_completion_callback_unittest.cc', | |
| 243 'disk_cache/addr_unittest.cc', | |
| 244 'disk_cache/backend_unittest.cc', | |
| 245 'disk_cache/block_files_unittest.cc', | |
| 246 'disk_cache/disk_cache_test_base.cc', | |
| 247 'disk_cache/disk_cache_test_util.cc', | |
| 248 'disk_cache/entry_unittest.cc', | |
| 249 'disk_cache/mapped_file_unittest.cc', | |
| 250 'disk_cache/storage_block_unittest.cc', | |
| 251 'http/http_auth_unittest.cc', | |
| 252 'http/http_auth_handler_basic_unittest.cc', | |
| 253 'http/http_auth_handler_digest_unittest.cc', | |
| 254 'http/http_chunked_decoder_unittest.cc', | |
| 255 'http/http_response_headers_unittest.cc', | |
| 256 'http/http_vary_data_unittest.cc', | |
| 257 ] | |
| 258 | |
| 259 if env['PLATFORM'] == 'win32': | |
| 260 unittest_files.extend([ | |
| 261 'base/directory_lister_unittest.cc', | |
| 262 'base/sdch_filter_unittest.cc', | |
| 263 'base/ssl_config_service_unittest.cc', | |
| 264 'base/ssl_client_socket_unittest.cc', | |
| 265 'base/wininet_util_unittest.cc', | |
| 266 'http/http_cache_unittest.cc', | |
| 267 'http/http_network_layer_unittest.cc', | |
| 268 'http/http_network_transaction_unittest.cc', | |
| 269 'http/http_transaction_unittest.cc', | |
| 270 'http/http_transaction_winhttp_unittest.cc', | |
| 271 'http/http_util_unittest.cc', | |
| 272 'http/winhttp_request_throttle_unittest.cc', | |
| 273 'url_request/url_request_unittest.cc', | |
| 274 ]) | |
| 275 | |
| 276 if env['PLATFORM'] == 'darwin': | |
| 277 unittest_files.extend([ | |
| 278 '../base/platform_test_mac.o', | |
| 279 ]) | |
| 280 | |
| 281 net_unittests = env_tests.ChromeTestProgram('net_unittests', unittest_files) | |
| 282 | |
| 283 install_targets = net_unittests[:] | |
| 284 | |
| 285 if env['PLATFORM'] in ('posix', 'win32'): | |
| 286 | |
| 287 net_perftests = env_tests.ChromeTestProgram( | |
| 288 'net_perftests', | |
| 289 ['disk_cache/disk_cache_test_util.cc', | |
| 290 'disk_cache/disk_cache_perftest.cc', | |
| 291 'base/cookie_monster_perftest.cc', | |
| 292 # TODO(sgk): avoid using .cc from base directly | |
| 293 '$BASE_DIR/run_all_perftests$OBJSUFFIX', | |
| 294 '$BASE_DIR/perftimer$OBJSUFFIX'] | |
| 295 ) | |
| 296 | |
| 297 install_targets.extend([ | |
| 298 net_perftests | |
| 299 ]) | |
| 300 | |
| 301 if env['PLATFORM'] == 'win32': | |
| 302 stress_cache = env_tests.ChromeTestProgram( | |
| 303 'stress_cache', | |
| 304 ['disk_cache/stress_cache.cc', | |
| 305 'disk_cache/disk_cache_test_util.cc'] | |
| 306 ) | |
| 307 | |
| 308 crash_cache = env_tests.ChromeTestProgram( | |
| 309 'crash_cache', | |
| 310 ['tools/crash_cache/crash_cache.cc', | |
| 311 'disk_cache/disk_cache_test_util.cc'] | |
| 312 ) | |
| 313 | |
| 314 install_targets.extend([ | |
| 315 stress_cache, | |
| 316 crash_cache, | |
| 317 ]) | |
| 318 | |
| 319 | |
| 320 # Create install of tests. | |
| 321 installed_tests = env.Install('$TARGET_ROOT', install_targets) | |
| 322 | |
| 323 | |
| 324 if env['PLATFORM'] == 'win32': | |
| 325 env_res.Append( | |
| 326 CPPPATH = [ | |
| 327 '..', | |
| 328 ], | |
| 329 RCFLAGS = [ | |
| 330 ['/l', '0x409'], | |
| 331 ], | |
| 332 ) | |
| 333 | |
| 334 # TODO: Need to figure out what we're doing with external resources on | |
| 335 # linux. | |
| 336 # This dat file needed by net_resources is generated. | |
| 337 tld_names_clean = env_res.Command('net/effective_tld_names_clean.dat', | |
| 338 ['base/effective_tld_names.dat', | |
| 339 'tools/tld_cleanup/tld_cleanup.exe'], | |
| 340 '${SOURCES[1]} ${SOURCES[0]} $TARGET') | |
| 341 rc = env_res.Command('net_resources.rc', | |
| 342 'base/net_resources.rc', | |
| 343 Copy('$TARGET', '$SOURCE')) | |
| 344 net_resources = env_res.RES(rc) | |
| 345 env_res.Depends(rc, tld_names_clean) | |
| 346 | |
| 347 # TODO: We need to port tld_cleanup before this will work on other | |
| 348 # platforms. | |
| 349 sconscript_files = [ | |
| 350 'tools/tld_cleanup/SConscript', | |
| 351 ] | |
| 352 | |
| 353 SConscript(sconscript_files, exports=['env']) | |
| 354 | |
| 355 | |
| 356 env.Alias('net', ['.', installed_tests]) | |
| OLD | NEW |