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/buildflag_header.gni") | |
5 import("//build/config/allocator.gni") | 6 import("//build/config/allocator.gni") |
6 import("//build/config/compiler/compiler.gni") | 7 import("//build/config/compiler/compiler.gni") |
7 | 8 |
8 if (is_win) { | 9 if (is_win) { |
9 import("//build/config/win/visual_studio_version.gni") | 10 import("//build/config/win/visual_studio_version.gni") |
10 } | 11 } |
11 | 12 |
12 declare_args() { | 13 declare_args() { |
13 # Provide a way to force disable debugallocation in Debug builds, | 14 # Provide a way to force disable debugallocation in Debug builds, |
14 # e.g. for profiling (it's more rare to profile Debug builds, | 15 # e.g. for profiling (it's more rare to profile Debug builds, |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
287 # Make sure the allocation library is optimized as much as possible when | 288 # Make sure the allocation library is optimized as much as possible when |
288 # we"re in release mode. | 289 # we"re in release mode. |
289 if (!is_debug) { | 290 if (!is_debug) { |
290 configs -= [ "//build/config/compiler:default_optimization" ] | 291 configs -= [ "//build/config/compiler:default_optimization" ] |
291 configs += [ "//build/config/compiler:optimize_max" ] | 292 configs += [ "//build/config/compiler:optimize_max" ] |
292 } | 293 } |
293 | 294 |
294 deps += [ "//base/third_party/dynamic_annotations" ] | 295 deps += [ "//base/third_party/dynamic_annotations" ] |
295 } | 296 } |
296 } # use_allocator == "tcmalloc" | 297 } # use_allocator == "tcmalloc" |
298 | |
299 buildflag_header("features") { | |
300 header = "features.h" | |
301 flags = [ "USE_EXPERIMENTAL_ALLOCATOR_SHIM=$use_experimental_allocator_shim" ] | |
302 } | |
303 | |
304 if (use_experimental_allocator_shim) { | |
305 source_set("unified_allocator_shim") { | |
306 # TODO(primiano): support other platforms, currently this works only on | |
307 # Linux/CrOS only. http://crbug.com/550886 . | |
Nico
2016/03/08 03:08:42
remove one of the two "only"
Primiano Tucci (use gerrit)
2016/03/08 20:54:05
But it was so symmetric :)
Done.
| |
308 configs += [ "//base:base_implementation" ] # for BASE_EXPORT | |
Nico
2016/03/08 03:08:41
give this
visibility = [ ":base" ]
too, to m
Primiano Tucci (use gerrit)
2016/03/08 20:54:04
TIL visibility in GN. Done.
| |
309 sources = [ | |
310 "allocator_shim.cc", | |
311 "allocator_shim.h", | |
312 "allocator_shim_internals.h", | |
313 "allocator_shim_override_cpp_symbols.h", | |
314 "allocator_shim_override_libc_symbols.h", | |
315 ] | |
316 if (is_linux && use_allocator == "tcmalloc") { | |
317 sources += [ | |
318 "allocator_shim_default_dispatch_to_tcmalloc.cc", | |
319 "allocator_shim_override_glibc_weak_symbols.h", | |
320 ] | |
321 deps = [ | |
322 ":tcmalloc", | |
323 ] | |
324 } else if (is_linux && use_allocator == "none") { | |
325 sources += [ "allocator_shim_default_dispatch_to_glibc.cc" ] | |
326 } | |
327 } | |
328 } | |
OLD | NEW |