Skip to content

Commit

Permalink
Minor GN build cleanup.
Browse files Browse the repository at this point in the history
Convert some static libraries to source sets.

Add an "icu" metalibrary that can be used by targets needing both ICU libs.

Rename some base targets to have shorter names.

BUG=
R=scottmg@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262442 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@chromium.org committed Apr 8, 2014
1 parent 91cd7a3 commit cc7ec69
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 29 deletions.
8 changes: 4 additions & 4 deletions base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ component("base") {
# This is the subset of files from base that should not be used with a dynamic
# library. Note that this library cannot depend on base because base depends on
# base_static.
static_library("base_static") {
source_set("base_static") {
sources = [
"base_switches.cc",
"base_switches.h",
Expand All @@ -849,7 +849,8 @@ static_library("base_static") {
]
}

component("base_i18n") {
component("i18n") {
output_name = "base_i18n"
sources = [
"i18n/base_i18n_export.h",
"i18n/bidi_line_iterator.cc",
Expand Down Expand Up @@ -884,8 +885,7 @@ component("base_i18n") {
deps = [
":base",
"//base/third_party/dynamic_annotations",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/icu",
]

if (toolkit_uses_gtk) {
Expand Down
10 changes: 5 additions & 5 deletions base/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import("//build/config/ui.gni")

static_library("test_support_base") {
source_set("test_support") {
sources = [
"expectations/expectation.cc",
"expectations/expectation.h",
Expand Down Expand Up @@ -92,7 +92,7 @@ static_library("test_support_base") {
deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//base:base_i18n",
"//base:i18n",
"//base:base_static",
"//testing/gmock",
"//testing/gtest",
Expand Down Expand Up @@ -128,7 +128,7 @@ static_library("test_support_perf") {
"run_all_perftests.cc",
]
deps = [
":test_support_base",
":test_support",
"//base",
"//testing/gtest",
]
Expand All @@ -140,11 +140,11 @@ static_library("test_support_perf") {
}
}

static_library("run_all_unittests") {
source_set("run_all_unittests") {
sources = [
"run_all_unittests.cc",
]
deps = [
":test_support_base",
":test_support",
]
}
8 changes: 4 additions & 4 deletions ipc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ test("ipc_tests") {
":ipc",
":test_support_ipc",
"//base",
"//base:base_i18n",
"//base:i18n",
"//base/test:run_all_unittests",
"//base/test:test_support_base",
"//base/test:test_support",
"//testing/gtest",
]
}
Expand Down Expand Up @@ -149,8 +149,8 @@ test("ipc_perftests") {
":ipc",
":test_support_ipc",
"//base",
"//base:base_i18n",
"//base/test:test_support_base",
"//base:i18n",
"//base/test:test_support",
"//base/test:test_support_perf",
"//testing/gtest",
]
Expand Down
2 changes: 1 addition & 1 deletion tools/gn/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ test("gn_unittests") {
deps = [
":gn_lib",
"//base/test:run_all_unittests",
"//base/test:test_support_base",
"//base/test:test_support",
"//testing/gtest",
]
}
Expand Down
3 changes: 1 addition & 2 deletions tools/gn/secondary/chrome/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ source_set("debugger") {
"//net",
"//net:http_server",
"//skia",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/icu",
"//third_party/leveldatabase",
"//third_party/libusb",
]
Expand Down
2 changes: 1 addition & 1 deletion tools/gn/secondary/crypto/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ test("crypto_unittests") {
":crypto",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support_base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
Expand Down
5 changes: 2 additions & 3 deletions tools/gn/secondary/net/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -1058,13 +1058,12 @@ component("net") {
deps = [
#":net_resources",
"//base",
"//base:base_i18n",
"//base:i18n",
"//base/third_party/dynamic_annotations",
"//crypto",
"//crypto/ssl:metassl",
"//sdch",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/icu",
"//third_party/zlib",
"//url",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ component("platform") {

deps = [
"//third_party/WebKit/Source/wtf",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/icu",
"//url",
]
}
Expand Down
5 changes: 2 additions & 3 deletions tools/gn/secondary/third_party/WebKit/Source/wtf/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ component("wtf") {

defines = [ "WTF_IMPLEMENTATION=1" ]
deps = [
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/icu",
]

# # Disable c4267 warnings until we fix size_t to int truncations.
Expand Down Expand Up @@ -312,7 +311,7 @@ static_library("run_all_tests") {
]

deps = [
"//base/test:test_support_base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
":wtf",
Expand Down
9 changes: 9 additions & 0 deletions tools/gn/secondary/third_party/icu/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Meta target that includes both icuuc and icui18n. Most targets want both.
# You can depend on the individually if you need to.
group("icu") {
deps = [
":icui18n",
":icuuc",
]
}

# Shared config used by ICU and all dependents.
config("icu_config") {
defines = [
Expand Down
2 changes: 1 addition & 1 deletion tools/gn/secondary/third_party/leveldatabase/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ test("env_chromium_unittests") {
]
deps = [
":leveldatabase",
"//base/test:test_support_base",
"//base/test:test_support",
"//testing/gtest",
]
}
Expand Down
5 changes: 2 additions & 3 deletions url/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ component("url") {
deps = [
"//base",
"//third_party/icu:icudata",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
"//third_party/icu",
]
}

Expand All @@ -78,7 +77,7 @@ test("url_unittests") {

deps = [
":url",
"//base:base_i18n",
"//base:i18n",
"//base/test:run_all_unittests",
"//testing/gtest",
"//third_party/icu:icuuc",
Expand Down

0 comments on commit cc7ec69

Please sign in to comment.