| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 # This config and libc modification are only used on Windows. | 53 # This config and libc modification are only used on Windows. |
| 54 if (is_win) { | 54 if (is_win) { |
| 55 import("//build/config/win/visual_studio_version.gni") | 55 import("//build/config/win/visual_studio_version.gni") |
| 56 | 56 |
| 57 config("nocmt") { | 57 config("nocmt") { |
| 58 ldflags = [ | 58 ldflags = [ |
| 59 "/NODEFAULTLIB:libcmt", | 59 "/NODEFAULTLIB:libcmt", |
| 60 "/NODEFAULTLIB:libcmtd", | 60 "/NODEFAULTLIB:libcmtd", |
| 61 ] | 61 ] |
| 62 libs = [ rebase_path("$target_gen_dir/allocator/libcmt.lib") ] | 62 libs = [ "$target_gen_dir/allocator/libcmt.lib" ] |
| 63 } | 63 } |
| 64 | 64 |
| 65 if (!is_component_build) { | 65 if (!is_component_build) { |
| 66 action("prep_libc") { | 66 action("prep_libc") { |
| 67 script = "prep_libc.py" | 67 script = "prep_libc.py" |
| 68 outputs = [ | 68 outputs = [ |
| 69 "$target_gen_dir/allocator/libcmt.lib", | 69 "$target_gen_dir/allocator/libcmt.lib", |
| 70 ] | 70 ] |
| 71 args = [ | 71 args = [ |
| 72 visual_studio_path + "/vc/lib", | 72 visual_studio_path + "/vc/lib", |
| 73 rebase_path("$target_gen_dir/allocator"), | 73 rebase_path("$target_gen_dir/allocator"), |
| 74 current_cpu, | 74 current_cpu, |
| 75 | 75 |
| 76 # The environment file in the build directory. This is required because | 76 # The environment file in the build directory. This is required because |
| 77 # the Windows toolchain setup saves the VC paths and such so that | 77 # the Windows toolchain setup saves the VC paths and such so that |
| 78 # running "mc.exe" will work with the configured toolchain. This file | 78 # running "mc.exe" will work with the configured toolchain. This file |
| 79 # is in the root build dir. | 79 # is in the root build dir. |
| 80 "environment.$current_cpu", | 80 "environment.$current_cpu", |
| 81 ] | 81 ] |
| 82 } | 82 } |
| 83 | 83 |
| 84 source_set("allocator_shim") { | 84 source_set("allocator_shim") { |
| 85 sources = [ | 85 sources = [ |
| 86 "allocator_shim_win.cc", | 86 "allocator_shim_win.cc", |
| 87 ] | 87 ] |
| 88 configs -= [ "//build/config/compiler:chromium_code" ] | 88 configs -= [ "//build/config/compiler:chromium_code" ] |
| 89 configs += [ "//build/config/compiler:no_chromium_code" ] | 89 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 90 | 90 |
| 91 public_configs = [ ":nocmt" ] | 91 public_configs = [ ":nocmt" ] |
| 92 public_deps = [ |
| 93 ":prep_libc", |
| 94 ] |
| 92 deps = [ | 95 deps = [ |
| 93 ":prep_libc", | |
| 94 "//base", | 96 "//base", |
| 95 ] | 97 ] |
| 96 } | 98 } |
| 97 } | 99 } |
| 98 } | 100 } |
| 99 | 101 |
| 100 if (use_allocator == "tcmalloc") { | 102 if (use_allocator == "tcmalloc") { |
| 101 # tcmalloc currently won't compile on Android. | 103 # tcmalloc currently won't compile on Android. |
| 102 # TODO(crbug.com/559766) this should be a source_set but | 104 # TODO(crbug.com/559766) this should be a source_set but |
| 103 # there are static initializers that get accidentally linked | 105 # there are static initializers that get accidentally linked |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 # Make sure the allocation library is optimized as much as possible when | 270 # Make sure the allocation library is optimized as much as possible when |
| 269 # we"re in release mode. | 271 # we"re in release mode. |
| 270 if (!is_debug) { | 272 if (!is_debug) { |
| 271 configs -= [ "//build/config/compiler:default_optimization" ] | 273 configs -= [ "//build/config/compiler:default_optimization" ] |
| 272 configs += [ "//build/config/compiler:optimize_max" ] | 274 configs += [ "//build/config/compiler:optimize_max" ] |
| 273 } | 275 } |
| 274 | 276 |
| 275 deps += [ "//base/third_party/dynamic_annotations" ] | 277 deps += [ "//base/third_party/dynamic_annotations" ] |
| 276 } | 278 } |
| 277 } # !is_android | 279 } # !is_android |
| OLD | NEW |