Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: base/allocator/BUILD.gn

Issue 1584893002: Allow base to depend on allocator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 if (is_win) { 8 if (is_win) {
9 import("//build/config/win/visual_studio_version.gni") 9 import("//build/config/win/visual_studio_version.gni")
10 } 10 }
11 11
12 declare_args() { 12 declare_args() {
13 # Provide a way to force disable debugallocation in Debug builds, 13 # Provide a way to force disable debugallocation in Debug builds,
14 # e.g. for profiling (it's more rare to profile Debug builds, 14 # e.g. for profiling (it's more rare to profile Debug builds,
15 # but people sometimes need to do that). 15 # but people sometimes need to do that).
16 enable_debugallocation = is_debug 16 enable_debugallocation = is_debug
17 } 17 }
18 18
19 # Only executables and not libraries should depend on the allocator target;
20 # only the application (the final executable) knows what allocator makes sense.
21 # This "allocator" meta-target will forward to the default allocator according 19 # This "allocator" meta-target will forward to the default allocator according
22 # to the build settings. 20 # to the build settings.
23 group("allocator") { 21 group("allocator") {
24 public_deps = [] 22 deps = []
23
25 if (use_allocator == "tcmalloc") { 24 if (use_allocator == "tcmalloc") {
26 public_deps += [ ":tcmalloc" ] 25 deps += [ ":tcmalloc" ]
27 } 26 }
28 27
29 # This condition expresses the win_use_allocator_shim in the GYP build. 28 # This condition expresses the win_use_allocator_shim in the GYP build.
30 if (is_win && !is_component_build && visual_studio_version != "2015") { 29 if (is_win && !is_component_build && visual_studio_version != "2015") {
31 public_deps += [ ":allocator_shim" ] 30 deps += [ ":allocator_shim" ]
31 all_dependent_configs = [ ":nocmt" ]
32 } 32 }
33 } 33 }
34 34
35 # This config defines ALLOCATOR_SHIM in the same conditions that the allocator 35 # This config defines ALLOCATOR_SHIM in the same conditions that the allocator
36 # shim will be used by the allocator target. 36 # shim will be used by the allocator target.
37 # 37 #
38 # TODO(brettw) this is only used in one place and is kind of mess, because it 38 # TODO(brettw) this is only used in one place and is kind of mess, because it
39 # assumes that the library using it will eventually be linked with 39 # assumes that the library using it will eventually be linked with
40 # //base/allocator in the default way. Clean this up and delete this. 40 # //base/allocator in the default way. Clean this up and delete this.
41 config("allocator_shim_define") { 41 config("allocator_shim_define") {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ] 100 ]
101 } 101 }
102 102
103 source_set("allocator_shim") { 103 source_set("allocator_shim") {
104 sources = [ 104 sources = [
105 "allocator_shim_win.cc", 105 "allocator_shim_win.cc",
106 ] 106 ]
107 configs -= [ "//build/config/compiler:chromium_code" ] 107 configs -= [ "//build/config/compiler:chromium_code" ]
108 configs += [ "//build/config/compiler:no_chromium_code" ] 108 configs += [ "//build/config/compiler:no_chromium_code" ]
109 109
110 public_configs = [ ":nocmt" ]
111 deps = [ 110 deps = [
112 ":prep_libc", 111 ":prep_libc",
113 "//base",
114 ] 112 ]
115 } 113 }
116 } 114 }
117 } 115 }
118 116
119 if (use_allocator == "tcmalloc") { 117 if (use_allocator == "tcmalloc") {
120 # tcmalloc currently won't compile on Android. 118 # tcmalloc currently won't compile on Android.
121 source_set("tcmalloc") { 119 source_set("tcmalloc") {
122 tcmalloc_dir = "//third_party/tcmalloc/chromium" 120 tcmalloc_dir = "//third_party/tcmalloc/chromium"
123 121
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 # Make sure the allocation library is optimized as much as possible when 281 # Make sure the allocation library is optimized as much as possible when
284 # we"re in release mode. 282 # we"re in release mode.
285 if (!is_debug) { 283 if (!is_debug) {
286 configs -= [ "//build/config/compiler:default_optimization" ] 284 configs -= [ "//build/config/compiler:default_optimization" ]
287 configs += [ "//build/config/compiler:optimize_max" ] 285 configs += [ "//build/config/compiler:optimize_max" ]
288 } 286 }
289 287
290 deps += [ "//base/third_party/dynamic_annotations" ] 288 deps += [ "//base/third_party/dynamic_annotations" ]
291 } 289 }
292 } # use_allocator == "tcmalloc" 290 } # use_allocator == "tcmalloc"
OLDNEW
« base/BUILD.gn ('K') | « base/BUILD.gn ('k') | base/allocator/allocator.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698