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

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: Move is_nacl condition to allocator group 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 if (!is_nacl) {
25 if (use_allocator == "tcmalloc") { 23 deps = []
26 public_deps += [ ":tcmalloc" ]
27 }
28 24
29 # This condition expresses the win_use_allocator_shim in the GYP build. 25 if (use_allocator == "tcmalloc") {
30 if (is_win && !is_component_build && visual_studio_version != "2015") { 26 deps += [ ":tcmalloc" ]
31 public_deps += [ ":allocator_shim" ] 27 }
32 } 28
29 # This condition expresses the win_use_allocator_shim in the GYP build.
30 if (is_win && !is_component_build && visual_studio_version != "2015") {
31 deps += [ ":allocator_shim" ]
32 all_dependent_configs = [ ":nocmt" ]
33 }
34 } # !is_nacl
33 } 35 }
34 36
35 # This config defines ALLOCATOR_SHIM in the same conditions that the allocator 37 # This config defines ALLOCATOR_SHIM in the same conditions that the allocator
36 # shim will be used by the allocator target. 38 # shim will be used by the allocator target.
37 # 39 #
38 # TODO(brettw) this is only used in one place and is kind of mess, because it 40 # 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 41 # assumes that the library using it will eventually be linked with
40 # //base/allocator in the default way. Clean this up and delete this. 42 # //base/allocator in the default way. Clean this up and delete this.
41 config("allocator_shim_define") { 43 config("allocator_shim_define") {
42 if (is_win && !is_component_build && visual_studio_version != "2015") { 44 if (is_win && !is_component_build && visual_studio_version != "2015") {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 ] 102 ]
101 } 103 }
102 104
103 source_set("allocator_shim") { 105 source_set("allocator_shim") {
104 sources = [ 106 sources = [
105 "allocator_shim_win.cc", 107 "allocator_shim_win.cc",
106 ] 108 ]
107 configs -= [ "//build/config/compiler:chromium_code" ] 109 configs -= [ "//build/config/compiler:chromium_code" ]
108 configs += [ "//build/config/compiler:no_chromium_code" ] 110 configs += [ "//build/config/compiler:no_chromium_code" ]
109 111
110 public_configs = [ ":nocmt" ]
111 deps = [ 112 deps = [
112 ":prep_libc", 113 ":prep_libc",
113 "//base",
114 ] 114 ]
115 } 115 }
116 } 116 }
117 } 117 }
118 118
119 if (use_allocator == "tcmalloc") { 119 if (use_allocator == "tcmalloc") {
120 # tcmalloc currently won't compile on Android. 120 # tcmalloc currently won't compile on Android.
121 source_set("tcmalloc") { 121 source_set("tcmalloc") {
122 tcmalloc_dir = "//third_party/tcmalloc/chromium" 122 tcmalloc_dir = "//third_party/tcmalloc/chromium"
123 123
(...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 283 # Make sure the allocation library is optimized as much as possible when
284 # we"re in release mode. 284 # we"re in release mode.
285 if (!is_debug) { 285 if (!is_debug) {
286 configs -= [ "//build/config/compiler:default_optimization" ] 286 configs -= [ "//build/config/compiler:default_optimization" ]
287 configs += [ "//build/config/compiler:optimize_max" ] 287 configs += [ "//build/config/compiler:optimize_max" ]
288 } 288 }
289 289
290 deps += [ "//base/third_party/dynamic_annotations" ] 290 deps += [ "//base/third_party/dynamic_annotations" ]
291 } 291 }
292 } # use_allocator == "tcmalloc" 292 } # use_allocator == "tcmalloc"
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/allocator/allocator.gyp » ('j') | base/base.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698