Index: base/allocator/BUILD.gn |
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn |
index ac29edf763466228978ca65e29f02f53b5d687d5..bbcd823cc1dd1d88fd5e00295f28c1dfa1193b60 100644 |
--- a/base/allocator/BUILD.gn |
+++ b/base/allocator/BUILD.gn |
@@ -3,6 +3,7 @@ |
# found in the LICENSE file. |
import("//build/config/allocator.gni") |
+import("//build/config/win/visual_studio_version.gni") |
# Only executables and not libraries should depend on the allocator target; |
# only the application (the final executable) knows what allocator makes sense. |
@@ -14,6 +15,14 @@ group("allocator") { |
} |
} |
+config("nocmt") { |
+ ldflags = [ |
+ "/NODEFAULTLIB:libcmt", |
+ "/NODEFAULTLIB:libcmtd", |
+ ] |
+ libs = [ rebase_path("$target_gen_dir/allocator/libcmt.lib") ] |
+} |
+ |
if (!is_android) { |
# tcmalloc currently won't compile on Android. |
source_set("tcmalloc") { |
@@ -152,6 +161,21 @@ if (!is_android) { |
"$tcmalloc_dir/src/profiler.cc", |
] |
defines += [ "PERFTOOLS_DLL_DECL=" ] |
+ |
+ direct_dependent_configs = [ ":nocmt" ] |
+ |
+ action("prep_libc") { |
brettw
2014/05/17 02:38:37
Can you avoid nesting targets? I've been wanting t
scottmg
2014/05/17 16:29:16
OK, I'll do that.
It seems unfortunate to move th
|
+ script = "prep_libc.py" |
+ outputs = [ "$target_gen_dir/allocator/libcmt.lib" ] |
+ args = [ |
+ visual_studio_path + "/vc/lib", |
+ rebase_path("$target_gen_dir/allocator"), |
+ cpu_arch, |
+ ] |
+ } |
+ deps = [ |
+ ":prep_libc", |
+ ] |
} |
if (is_linux || is_android) { |
sources -= [ |
@@ -191,7 +215,7 @@ if (!is_android) { |
configs += [ "//build/config/compiler:optimize_max" ] |
} |
- deps = [ |
+ deps += [ |
"//base/third_party/dynamic_annotations", |
] |