Commit 9052d3e7 authored by scottmg@chromium.org's avatar scottmg@chromium.org

GN win: prep_libc and fix tcmalloc linkage

On top of https://codereview.chromium.org/290633012/

R=brettw@chromium.org

Review URL: https://codereview.chromium.org/290713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272249 0039d316-1c4b-4281-b951-d872f2087c98
parent acc2ce55
......@@ -14,6 +14,29 @@ group("allocator") {
}
}
# This config and libc modification are only used on Windows.
if (is_win) {
import("//build/config/win/visual_studio_version.gni")
config("nocmt") {
ldflags = [
"/NODEFAULTLIB:libcmt",
"/NODEFAULTLIB:libcmtd",
]
libs = [ rebase_path("$target_gen_dir/allocator/libcmt.lib") ]
}
action("prep_libc") {
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,
]
}
}
if (!is_android) {
# tcmalloc currently won't compile on Android.
source_set("tcmalloc") {
......@@ -125,6 +148,8 @@ if (!is_android) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
deps = []
if (is_win) {
sources -= [
"$tcmalloc_dir/src/base/elf_mem_image.cc",
......@@ -152,7 +177,14 @@ if (!is_android) {
"$tcmalloc_dir/src/profiler.cc",
]
defines += [ "PERFTOOLS_DLL_DECL=" ]
direct_dependent_configs = [ ":nocmt" ]
deps += [
":prep_libc",
]
}
if (is_linux || is_android) {
sources -= [
"$tcmalloc_dir/src/system-alloc.h",
......@@ -191,7 +223,7 @@ if (!is_android) {
configs += [ "//build/config/compiler:optimize_max" ]
}
deps = [
deps += [
"//base/third_party/dynamic_annotations",
]
......
......@@ -12,7 +12,7 @@
# VCLibDir is the path where VC is installed, something like:
# C:\Program Files\Microsoft Visual Studio 8\VC\lib
# OutputDir is the directory where the modified libcmt file should be stored.
# arch is either 'ia32' or 'x64'
# arch is one of: 'ia32', 'x86' or 'x64'. ia32 and x86 are synonyms.
import os
import shutil
......
......@@ -19,4 +19,3 @@ if (visual_studio_path == "") {
visual_studio_path = toolchain_data[0]
windows_sdk_path = toolchain_data[1]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment