| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/allocator.gni") | 5 import("//build/config/allocator.gni") |
| 6 import("//build/config/compiler/compiler.gni") | 6 import("//build/config/compiler/compiler.gni") |
| 7 | 7 |
| 8 declare_args() { | 8 declare_args() { |
| 9 # Provide a way to force disable debugallocation in Debug builds, | 9 # Provide a way to force disable debugallocation in Debug builds, |
| 10 # e.g. for profiling (it's more rare to profile Debug builds, | 10 # e.g. for profiling (it's more rare to profile Debug builds, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 ] | 213 ] |
| 214 | 214 |
| 215 configs -= [ "//build/config/compiler:chromium_code" ] | 215 configs -= [ "//build/config/compiler:chromium_code" ] |
| 216 configs += [ | 216 configs += [ |
| 217 "//build/config/compiler:no_chromium_code", | 217 "//build/config/compiler:no_chromium_code", |
| 218 ":tcmalloc_flags", | 218 ":tcmalloc_flags", |
| 219 ] | 219 ] |
| 220 | 220 |
| 221 deps = [] | 221 deps = [] |
| 222 | 222 |
| 223 if (is_win) { | |
| 224 sources -= [ | |
| 225 "$tcmalloc_dir/src/base/elf_mem_image.cc", | |
| 226 "$tcmalloc_dir/src/base/elf_mem_image.h", | |
| 227 "$tcmalloc_dir/src/base/linuxthreads.cc", | |
| 228 "$tcmalloc_dir/src/base/linuxthreads.h", | |
| 229 "$tcmalloc_dir/src/base/vdso_support.cc", | |
| 230 "$tcmalloc_dir/src/base/vdso_support.h", | |
| 231 "$tcmalloc_dir/src/maybe_threads.cc", | |
| 232 "$tcmalloc_dir/src/maybe_threads.h", | |
| 233 "$tcmalloc_dir/src/symbolize.h", | |
| 234 "$tcmalloc_dir/src/system-alloc.cc", | |
| 235 "$tcmalloc_dir/src/system-alloc.h", | |
| 236 ] | |
| 237 | |
| 238 defines += [ "PERFTOOLS_DLL_DECL=" ] | |
| 239 | |
| 240 configs -= [ | |
| 241 # Tcmalloc defines this itself, and we don't want duplicate definition | |
| 242 # warnings. | |
| 243 "//build/config/win:nominmax", | |
| 244 ] | |
| 245 | |
| 246 public_configs = [ ":nocmt" ] | |
| 247 | |
| 248 deps += [ ":prep_libc" ] | |
| 249 } | |
| 250 | |
| 251 if (enable_profiling) { | 223 if (enable_profiling) { |
| 252 sources += [ | 224 sources += [ |
| 253 "$tcmalloc_dir/src/base/thread_lister.c", | 225 "$tcmalloc_dir/src/base/thread_lister.c", |
| 254 "$tcmalloc_dir/src/base/thread_lister.h", | 226 "$tcmalloc_dir/src/base/thread_lister.h", |
| 255 "$tcmalloc_dir/src/profile-handler.cc", | 227 "$tcmalloc_dir/src/profile-handler.cc", |
| 256 "$tcmalloc_dir/src/profile-handler.h", | 228 "$tcmalloc_dir/src/profile-handler.h", |
| 257 "$tcmalloc_dir/src/profiledata.cc", | 229 "$tcmalloc_dir/src/profiledata.cc", |
| 258 "$tcmalloc_dir/src/profiledata.h", | 230 "$tcmalloc_dir/src/profiledata.h", |
| 259 "$tcmalloc_dir/src/profiler.cc", | 231 "$tcmalloc_dir/src/profiler.cc", |
| 260 ] | 232 ] |
| (...skipping 30 matching lines...) Expand all Loading... |
| 291 } | 263 } |
| 292 | 264 |
| 293 # Make sure the allocation library is optimized as much as possible when | 265 # Make sure the allocation library is optimized as much as possible when |
| 294 # we"re in release mode. | 266 # we"re in release mode. |
| 295 if (!is_debug) { | 267 if (!is_debug) { |
| 296 configs -= [ "//build/config/compiler:default_optimization" ] | 268 configs -= [ "//build/config/compiler:default_optimization" ] |
| 297 configs += [ "//build/config/compiler:optimize_max" ] | 269 configs += [ "//build/config/compiler:optimize_max" ] |
| 298 } | 270 } |
| 299 | 271 |
| 300 deps += [ "//base/third_party/dynamic_annotations" ] | 272 deps += [ "//base/third_party/dynamic_annotations" ] |
| 301 | |
| 302 if (is_win) { | |
| 303 ldflags = [ "/ignore:4006:4221" ] | |
| 304 } | |
| 305 } | 273 } |
| 306 } # !is_android | 274 } # !is_android |
| 307 | 275 |
| 308 source_set("extension_thunks") { | 276 source_set("extension_thunks") { |
| 309 visibility = [ "//base/*" ] | 277 visibility = [ "//base/*" ] |
| 310 sources = [ | 278 sources = [ |
| 311 "allocator_extension_thunks.cc", | 279 "allocator_extension_thunks.cc", |
| 312 "allocator_extension_thunks.h", | 280 "allocator_extension_thunks.h", |
| 313 ] | 281 ] |
| 314 if (is_android && !is_debug) { | 282 if (is_android && !is_debug) { |
| 315 configs -= [ "//build/config/compiler:default_optimization" ] | 283 configs -= [ "//build/config/compiler:default_optimization" ] |
| 316 configs += [ "//build/config/compiler:optimize_max" ] | 284 configs += [ "//build/config/compiler:optimize_max" ] |
| 317 } | 285 } |
| 318 } | 286 } |
| OLD | NEW |