Hook up base unit tests and allocator to GN build.

Adds a meta-target "//base/allocator" that forwards to tcmallor or nothing depending on the build configuration.

Write tcmalloc target definition.

Write base unit tests prefs, and some support targets from base.gypi.

Fix a bunch of added files in the base target that were exposed by linking the unit tests.

Removes toolkit_uses_gtk which was removed from the GYP build.

BUG=
R=scottmg@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/build@271079 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
brettw@chromium.org 2014-05-16 19:33:08 +00:00
Родитель 6c4f020b94
Коммит 6e16d7065e
3 изменённых файлов: 18 добавлений и 3 удалений

Просмотреть файл

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/allocator.gni")
import("//build/config/crypto.gni")
import("//build/config/features.gni")
import("//build/config/ui.gni")
@ -120,6 +121,9 @@ config("feature_flags") {
defines += [ "USE_XI2_MT=$use_xi2_mt" ]
}
}
if (use_allocator != "tcmalloc") {
defines += [ "NO_TCMALLOC" ]
}
}
# Debug/release ----------------------------------------------------------------

14
config/allocator.gni Normal file
Просмотреть файл

@ -0,0 +1,14 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if (is_android || cpu_arch == "mipsel") {
_default_allocator = "none"
} else {
_default_allocator = "tcmalloc"
}
declare_args() {
# Memory allocator to use. Set to "none" to use default allocator.
use_allocator = _default_allocator
}

Просмотреть файл

@ -44,9 +44,6 @@ if (is_linux) {
use_pango = false
}
# Indicates if the UI toolkit depends on GTK.
toolkit_uses_gtk = is_linux && !is_chromeos && !use_aura && !use_ozone
# Use GPU accelerated cross process image transport by default on linux builds
# with the Aura window manager.
ui_compositor_image_transport = use_aura && is_linux