summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-03 17:16:11 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-03 17:16:11 +0000
commit6a0f2776a2d726b6f903ef7d82a482f5db1a3a56 (patch)
tree42f1842dc210a224b22a33c82f235bab00a5c474
parentd86c06c97a9736a4f852e8e7321f36a4bab1560d (diff)
downloadchromium_src-6a0f2776a2d726b6f903ef7d82a482f5db1a3a56.zip
chromium_src-6a0f2776a2d726b6f903ef7d82a482f5db1a3a56.tar.gz
chromium_src-6a0f2776a2d726b6f903ef7d82a482f5db1a3a56.tar.bz2
Some fixes for the GYP subcommand of GN
This adds support for writing shorter paths if an output file is inside the output directory (previously we'd write "../../out/Debug/foo" when we could just write "foo"). Fixing this was necessary because we need to match GYP's input/output files exactly and GYP does this. I also fixed a buf with outputting root dirs not ending with a slash, and added an assertion that the output isn't system-absolute (since the code doesn't handle this yet). The GYP integration didn't work due to slashes being different on Windows, so I convert them whem I read GYP's ninja file. I also deal with Windows lineendings. Some buildfile fixes for GYP compatibility, and the previous patch had the wrong name for LASTCHANGE. I changed the default to a non-component build since this is the GYP default. They both need to agree about this. BUG= R=scottmg@chromium.org Review URL: https://codereview.chromium.org/25058007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226777 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/gn/command_gyp.cc7
-rw-r--r--tools/gn/ninja_script_target_writer.cc9
-rw-r--r--tools/gn/path_output.cc32
-rw-r--r--tools/gn/path_output.h5
-rw-r--r--tools/gn/path_output_unittest.cc42
-rw-r--r--tools/gn/secondary/BUILD.gn4
-rw-r--r--tools/gn/secondary/build/config/BUILDCONFIG.gn2
-rw-r--r--tools/gn/secondary/chrome/BUILD.gn2
-rw-r--r--tools/gn/secondary/crypto/BUILD.gn31
-rw-r--r--tools/gn/secondary/crypto/ssl/BUILD.gn2
-rw-r--r--tools/gn/secondary/net/BUILD.gn7
-rw-r--r--tools/gn/secondary/net/third_party/nss/BUILD.gn91
-rw-r--r--tools/gn/secondary/net/third_party/nss/ssl/BUILD.gn93
-rw-r--r--tools/gn/secondary/sdch/BUILD.gn2
-rw-r--r--tools/gn/secondary/skia/BUILD.gn45
-rw-r--r--tools/gn/secondary/third_party/leveldatabase/BUILD.gn1
-rw-r--r--tools/gn/secondary/third_party/libxml/BUILD.gn2
-rw-r--r--tools/gn/secondary/third_party/snappy/BUILD.gn2
-rw-r--r--tools/gn/secondary/third_party/zlib/BUILD.gn10
-rw-r--r--tools/gn/target.cc6
20 files changed, 240 insertions, 155 deletions
diff --git a/tools/gn/command_gyp.cc b/tools/gn/command_gyp.cc
index bb74a42..73e33e5 100644
--- a/tools/gn/command_gyp.cc
+++ b/tools/gn/command_gyp.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
#include <fstream>
#include "base/atomicops.h"
@@ -10,6 +11,7 @@
#include "base/file_util.h"
#include "base/process/launch.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "tools/gn/build_settings.h"
#include "tools/gn/commands.h"
@@ -70,6 +72,11 @@ bool SimpleNinjaParse(const std::string& data,
std::string filename = data.substr(
next_subninja + kSubninjaPrefixLen,
line_end - next_subninja - kSubninjaPrefixLen);
+ TrimWhitespaceASCII(filename, TRIM_ALL, &filename);
+#if defined(OS_WIN)
+ // We always want our array to use forward slashes.
+ std::replace(filename.begin(), filename.end(), '\\', '/');
+#endif
subninjas->insert(filename);
next_subninja = line_end;
diff --git a/tools/gn/ninja_script_target_writer.cc b/tools/gn/ninja_script_target_writer.cc
index e74459c..4678ba0 100644
--- a/tools/gn/ninja_script_target_writer.cc
+++ b/tools/gn/ninja_script_target_writer.cc
@@ -75,14 +75,17 @@ std::string NinjaScriptTargetWriter::WriteRuleDefinition(
rspfile += ".rsp";
out_ << "rule " << custom_rule_name << std::endl;
- out_ << " command = $pythonpath gyp-win-tool action-wrapper $arch "
- << rspfile << std::endl;
+ out_ << " command = ";
+ path_output_.WriteFile(out_, settings_->build_settings()->python_path());
+ out_ << " gyp-win-tool action-wrapper $arch " << rspfile << std::endl;
out_ << " description = CUSTOM " << target_label << std::endl;
out_ << " restat = 1" << std::endl;
out_ << " rspfile = " << rspfile << std::endl;
// The build command goes in the rsp file.
- out_ << " rspfile_content = $pythonpath ";
+ out_ << " rspfile_content = ";
+ path_output_.WriteFile(out_, settings_->build_settings()->python_path());
+ out_ << " ";
path_output_.WriteFile(out_, target_->script_values().script());
args_template.WriteWithNinjaExpansions(out_);
out_ << std::endl;
diff --git a/tools/gn/path_output.cc b/tools/gn/path_output.cc
index f67b3d4..4e71f9b 100644
--- a/tools/gn/path_output.cc
+++ b/tools/gn/path_output.cc
@@ -13,6 +13,10 @@ PathOutput::PathOutput(const SourceDir& current_dir,
EscapingMode escaping,
bool convert_slashes)
: current_dir_(current_dir) {
+ CHECK(current_dir.is_source_absolute())
+ << "Currently this only supports writing to output directories inside "
+ "the source root. There needs to be some tweaks to PathOutput to make "
+ "doing this work correctly.";
inverse_current_dir_ = InvertDir(current_dir_);
options_.mode = escaping;
@@ -36,7 +40,10 @@ void PathOutput::WriteDir(std::ostream& out,
if (dir.value() == "/") {
// Writing system root is always a slash (this will normally only come up
// on Posix systems).
- out << "/";
+ if (slash_ending == DIR_NO_LAST_SLASH)
+ out << "/.";
+ else
+ out << "/";
} else if (dir.value() == "//") {
// Writing out the source root.
if (slash_ending == DIR_NO_LAST_SLASH) {
@@ -54,6 +61,13 @@ void PathOutput::WriteDir(std::ostream& out,
else
out << inverse_current_dir_;
}
+ } else if (dir == current_dir_) {
+ // Writing the same directory. This needs special handling here since
+ // we need to output something else other than the input.
+ if (slash_ending == DIR_INCLUDE_LAST_SLASH)
+ out << "./";
+ else
+ out << ".";
} else if (slash_ending == DIR_INCLUDE_LAST_SLASH) {
WritePathStr(out, dir.value());
} else {
@@ -68,11 +82,15 @@ void PathOutput::WriteFile(std::ostream& out, const OutputFile& file) const {
EscapeStringToStream(out, file.value(), options_);
}
+void PathOutput::WriteFile(std::ostream& out,
+ const base::FilePath& file) const {
+ // Assume native file paths are always absolute.
+ EscapeStringToStream(out, FilePathToUTF8(file), options_);
+}
+
void PathOutput::WriteSourceRelativeString(
std::ostream& out,
const base::StringPiece& str) const {
- // Input begins with two slashes, is relative to source root. Strip off
- // the two slashes when cat-ing it.
if (options_.mode == ESCAPE_SHELL) {
// Shell escaping needs an intermediate string since it may end up
// quoting the whole thing. On Windows, the slashes may already be
@@ -100,7 +118,13 @@ void PathOutput::WritePathStr(std::ostream& out,
const base::StringPiece& str) const {
DCHECK(str.size() > 0 && str[0] == '/');
- if (str.size() >= 2 && str[1] == '/') {
+ if (str.substr(0, current_dir_.value().size()) ==
+ base::StringPiece(current_dir_.value())) {
+ // The current dir is a prefix of the output file, so we can strip the
+ // prefix and write out the result.
+ EscapeStringToStream(out, str.substr(current_dir_.value().size()),
+ options_);
+ } else if (str.size() >= 2 && str[1] == '/') {
WriteSourceRelativeString(out, str.substr(2));
} else {
// Input begins with one slash, don't write the current directory since
diff --git a/tools/gn/path_output.h b/tools/gn/path_output.h
index 00bdbee..7372d47 100644
--- a/tools/gn/path_output.h
+++ b/tools/gn/path_output.h
@@ -16,6 +16,10 @@
class OutputFile;
class SourceFile;
+namespace base {
+class FilePath;
+}
+
// Writes file names to streams assuming a certain input directory and
// escaping rules. This gives us a central place for managing this state.
class PathOutput {
@@ -53,6 +57,7 @@ class PathOutput {
void WriteFile(std::ostream& out, const SourceFile& file) const;
void WriteFile(std::ostream& out, const OutputFile& file) const;
+ void WriteFile(std::ostream& out, const base::FilePath& file) const;
void WriteDir(std::ostream& out,
const SourceDir& dir,
DirSlashEnding slash_ending) const;
diff --git a/tools/gn/path_output_unittest.cc b/tools/gn/path_output_unittest.cc
index 5133b79..49f29c9 100644
--- a/tools/gn/path_output_unittest.cc
+++ b/tools/gn/path_output_unittest.cc
@@ -24,6 +24,14 @@ TEST(PathOutput, Basic) {
writer.WriteFile(out, SourceFile("//foo.cc"));
EXPECT_EQ("../../foo.cc", out.str());
}
+ {
+ // Files in the output dir.
+ std::ostringstream out;
+ writer.WriteFile(out, SourceFile("//out/Debug/foo.cc"));
+ out << " ";
+ writer.WriteFile(out, SourceFile("//out/Debug/bar/baz.cc"));
+ EXPECT_EQ("foo.cc bar/baz.cc", out.str());
+ }
#if defined(OS_WIN)
{
// System-absolute path.
@@ -170,9 +178,41 @@ TEST(PathOutput, WriteDir) {
{
std::ostringstream out;
writer.WriteDir(out, SourceDir("/"),
- PathOutput::DIR_NO_LAST_SLASH);
+ PathOutput::DIR_INCLUDE_LAST_SLASH);
EXPECT_EQ("/", out.str());
}
+ {
+ std::ostringstream out;
+ writer.WriteDir(out, SourceDir("/"),
+ PathOutput::DIR_NO_LAST_SLASH);
+ EXPECT_EQ("/.", out.str());
+ }
+
+ // Output inside current dir.
+ {
+ std::ostringstream out;
+ writer.WriteDir(out, SourceDir("//out/Debug/"),
+ PathOutput::DIR_INCLUDE_LAST_SLASH);
+ EXPECT_EQ("./", out.str());
+ }
+ {
+ std::ostringstream out;
+ writer.WriteDir(out, SourceDir("//out/Debug/"),
+ PathOutput::DIR_NO_LAST_SLASH);
+ EXPECT_EQ(".", out.str());
+ }
+ {
+ std::ostringstream out;
+ writer.WriteDir(out, SourceDir("//out/Debug/foo/"),
+ PathOutput::DIR_INCLUDE_LAST_SLASH);
+ EXPECT_EQ("foo/", out.str());
+ }
+ {
+ std::ostringstream out;
+ writer.WriteDir(out, SourceDir("//out/Debug/foo/"),
+ PathOutput::DIR_NO_LAST_SLASH);
+ EXPECT_EQ("foo", out.str());
+ }
}
{
// Empty build dir writer.
diff --git a/tools/gn/secondary/BUILD.gn b/tools/gn/secondary/BUILD.gn
index a99dbac..baf8664 100644
--- a/tools/gn/secondary/BUILD.gn
+++ b/tools/gn/secondary/BUILD.gn
@@ -9,11 +9,11 @@ group("root") {
"//crypto",
"//ipc",
"//net",
- "//net/third_party/nss/ssl",
+ "//net/third_party/nss:ssl",
"//sdch",
"//third_party/icu:icudata",
"//third_party/leveldatabase",
- "//third_party/zlib:chrome_zlib",
+ "//third_party/zlib",
"//skia",
"//tools/gn",
"//url",
diff --git a/tools/gn/secondary/build/config/BUILDCONFIG.gn b/tools/gn/secondary/build/config/BUILDCONFIG.gn
index 10cb3b3..89ec6f7 100644
--- a/tools/gn/secondary/build/config/BUILDCONFIG.gn
+++ b/tools/gn/secondary/build/config/BUILDCONFIG.gn
@@ -20,7 +20,7 @@ declare_args() {
# Set to build the Android version.
is_android = false
# Component build.
- is_component_build = true
+ is_component_build = false
# ChromeOS build.
is_chromeos = false
# Debug build.
diff --git a/tools/gn/secondary/chrome/BUILD.gn b/tools/gn/secondary/chrome/BUILD.gn
index 4ba0c43..d2e6795 100644
--- a/tools/gn/secondary/chrome/BUILD.gn
+++ b/tools/gn/secondary/chrome/BUILD.gn
@@ -195,7 +195,7 @@ custom("about_credits") {
# is added or removed, it will change the result, but there is no way to
# express this as a build dependency. We approximate this by depending on
# the last change file to force an update whenever the code is updated.
- source_prereqs = [ "//build/utils/LASTCHANGE" ]
+ source_prereqs = [ "//build/util/LASTCHANGE" ]
hard_dep = true
diff --git a/tools/gn/secondary/crypto/BUILD.gn b/tools/gn/secondary/crypto/BUILD.gn
index 248b699..111c61b 100644
--- a/tools/gn/secondary/crypto/BUILD.gn
+++ b/tools/gn/secondary/crypto/BUILD.gn
@@ -4,8 +4,21 @@
import("ssl/flags.gni")
+crypto_minimal_sources = [
+ "hmac.cc",
+ "hmac.h",
+ "hmac_win.cc",
+ "secure_util.cc",
+ "secure_util.h",
+ "symmetric_key.h",
+ "symmetric_key_win.cc",
+ "third_party/nss/chromium-sha256.h",
+ "third_party/nss/sha512.cc",
+]
+
component("crypto") {
external = true
+ output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [
"apple_keychain.h",
"apple_keychain_ios.mm",
@@ -86,7 +99,6 @@ component("crypto") {
]
deps = [
- ":crypto_minimal",
"//base",
"//base/third_party/dynamic_annotations",
"//crypto/ssl:metassl",
@@ -164,23 +176,18 @@ component("crypto") {
}
defines = [ "CRYPTO_IMPLEMENTATION" ]
+
+ # TODO(brettw) once GYP compat is no longer necessary, just move
+ # crypto_minimal_sources to the crypto_minimal target and include a
+ # dependency on it here.
+ sources += crypto_minimal_sources
}
# A minimal crypto subset for core features that small standalone targets can
# use to reduce code size.
static_library("crypto_minimal") {
external = true
- sources = [
- "hmac.cc",
- "hmac.h",
- "hmac_win.cc",
- "secure_util.cc",
- "secure_util.h",
- "symmetric_key.h",
- "symmetric_key_win.cc",
- "third_party/nss/chromium-sha256.h",
- "third_party/nss/sha512.cc",
- ]
+ sources = crypto_minimal_sources
deps = [
"//base",
diff --git a/tools/gn/secondary/crypto/ssl/BUILD.gn b/tools/gn/secondary/crypto/ssl/BUILD.gn
index a937a70..249ecc1 100644
--- a/tools/gn/secondary/crypto/ssl/BUILD.gn
+++ b/tools/gn/secondary/crypto/ssl/BUILD.gn
@@ -36,7 +36,7 @@ group("metassl") {
assert(is_linux)
direct_dependent_configs = ":system_ssl_config"
} else {
- deps = [ "//net/third_party/nss/ssl" ]
+ deps = [ "//net/third_party/nss:ssl" ]
}
forward_dependent_configs_from = deps
diff --git a/tools/gn/secondary/net/BUILD.gn b/tools/gn/secondary/net/BUILD.gn
index 95ac4bd..840a6de 100644
--- a/tools/gn/secondary/net/BUILD.gn
+++ b/tools/gn/secondary/net/BUILD.gn
@@ -1068,7 +1068,7 @@ component("net") {
"//sdch",
"//third_party/icu:icui18n",
"//third_party/icu:icuuc",
- "//third_party/zlib:chrome_zlib",
+ "//third_party/zlib",
"//url",
]
@@ -1084,7 +1084,7 @@ component("net") {
"udp/udp_socket_libevent.h",
]
deps += [
- #"//net/third_party/nss/ssl:crssl",
+ #"//net/third_party/nss:ssl",
#"//third_party/nss:nspr",
#"//third_party/nss:nss",
]
@@ -1104,7 +1104,7 @@ component("net") {
"ssl/client_cert_store_impl_nss.cc",
]
deps += [
- #"//net/third_party/nss/ssl:crssl",
+ #"//net/third_party/nss:ssl",
#"//third_party/nss:nspr",
#"//third_party/nss:nss",
]
@@ -1207,6 +1207,7 @@ grit("net_resources") {
}
static_library("http_server") {
+ external = true
sources = [
"server/http_connection.cc",
"server/http_connection.h",
diff --git a/tools/gn/secondary/net/third_party/nss/BUILD.gn b/tools/gn/secondary/net/third_party/nss/BUILD.gn
index 4e943c4..17a9bd1 100644
--- a/tools/gn/secondary/net/third_party/nss/BUILD.gn
+++ b/tools/gn/secondary/net/third_party/nss/BUILD.gn
@@ -1,3 +1,94 @@
# Copyright (c) 2013 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.
+
+config("crssl_config") {
+ includes = [
+ "//net/third_party/nss/ssl",
+ ]
+}
+
+# TODO(brettw) move this to net/third_party/nss/ssl once GYP backwards-compat
+# is no longer needed.
+component("ssl") {
+ external = true
+ # Not named "ssl" so the lib doesn't conflict with OpenSSL's libssl
+ output_name = "crssl"
+
+ sources = [
+ "ssl/authcert.c",
+ "ssl/cmpcert.c",
+ "ssl/derive.c",
+ "ssl/dtlscon.c",
+ #"ssl/os2_err.c",
+ #"ssl/os2_err.h",
+ "ssl/preenc.h",
+ "ssl/prelib.c",
+ "ssl/ssl.h",
+ "ssl/ssl3con.c",
+ "ssl/ssl3ecc.c",
+ "ssl/ssl3ext.c",
+ "ssl/ssl3gthr.c",
+ "ssl/ssl3prot.h",
+ "ssl/sslauth.c",
+ "ssl/sslcon.c",
+ "ssl/ssldef.c",
+ "ssl/sslenum.c",
+ "ssl/sslerr.c",
+ "ssl/sslerr.h",
+ "ssl/SSLerrs.h",
+ "ssl/sslerrstrs.c",
+ "ssl/sslgathr.c",
+ "ssl/sslimpl.h",
+ "ssl/sslinfo.c",
+ "ssl/sslinit.c",
+ "ssl/sslmutex.c",
+ "ssl/sslmutex.h",
+ "ssl/sslnonce.c",
+ "ssl/sslplatf.c",
+ "ssl/sslproto.h",
+ "ssl/sslreveal.c",
+ "ssl/sslsecur.c",
+ "ssl/sslsnce.c",
+ "ssl/sslsock.c",
+ "ssl/sslt.h",
+ "ssl/ssltrace.c",
+ "ssl/sslver.c",
+ "ssl/unix_err.c",
+ "ssl/unix_err.h",
+ "ssl/win32err.c",
+ "ssl/win32err.h",
+ "ssl/bodge/secitem_array.c",
+ ]
+
+ defines = [
+ "NO_PKCS11_BYPASS",
+ "NSS_ENABLE_ECC",
+ "USE_UTIL_DIRECTLY",
+ ]
+
+ configs -= "//build/config/compiler:chromium_code"
+ configs += "//build/config/compiler:no_chromium_code"
+
+ direct_dependent_configs = [ ":crssl_config" ]
+
+ if (is_win) {
+ sources -= [
+ "ssl/unix_err.c",
+ "ssl/unix_err.h",
+ ]
+ } else {
+ sources -= [
+ "ssl/win32err.c",
+ "ssl/win32err.h",
+ ]
+ }
+
+ if (is_linux) {
+ includes = [ "bodge" ]
+ configs += "//third_party/nss:nss_linux_config"
+ }
+ if (is_mac) {
+ sources -= "ssl/bodge/secitem_array.c"
+ }
+}
diff --git a/tools/gn/secondary/net/third_party/nss/ssl/BUILD.gn b/tools/gn/secondary/net/third_party/nss/ssl/BUILD.gn
deleted file mode 100644
index a06d85b..0000000
--- a/tools/gn/secondary/net/third_party/nss/ssl/BUILD.gn
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright (c) 2013 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.
-
-config("crssl_config") {
- includes = [
- "//net/third_party/nss/ssl",
- ]
-}
-
-component("ssl") {
- external = true
- # Not named "ssl" so the lib doesn't conflict with OpenSSL's libssl
- output_name = "crssl"
-
- sources = [
- "authcert.c",
- "cmpcert.c",
- "derive.c",
- "dtlscon.c",
- #"os2_err.c",
- #"os2_err.h",
- "preenc.h",
- "prelib.c",
- "ssl.h",
- "ssl3con.c",
- "ssl3ecc.c",
- "ssl3ext.c",
- "ssl3gthr.c",
- "ssl3prot.h",
- "sslauth.c",
- "sslcon.c",
- "ssldef.c",
- "sslenum.c",
- "sslerr.c",
- "sslerr.h",
- "SSLerrs.h",
- "sslerrstrs.c",
- "sslgathr.c",
- "sslimpl.h",
- "sslinfo.c",
- "sslinit.c",
- "sslmutex.c",
- "sslmutex.h",
- "sslnonce.c",
- "sslplatf.c",
- "sslproto.h",
- "sslreveal.c",
- "sslsecur.c",
- "sslsnce.c",
- "sslsock.c",
- "sslt.h",
- "ssltrace.c",
- "sslver.c",
- "unix_err.c",
- "unix_err.h",
- "win32err.c",
- "win32err.h",
- "bodge/secitem_array.c",
- ]
-
- defines = [
- "NO_PKCS11_BYPASS",
- "NSS_ENABLE_ECC",
- "USE_UTIL_DIRECTLY",
- ]
-
- configs -= "//build/config/compiler:chromium_code"
- configs += "//build/config/compiler:no_chromium_code"
-
- direct_dependent_configs = [ ":crssl_config" ]
-
- if (is_win) {
- sources -= [
- "unix_err.c",
- "unix_err.h",
- ]
- } else {
- sources -= [
- "win32err.c",
- "win32err.h",
- ]
- }
-
- if (is_linux) {
- includes = [ "bodge" ]
- configs += "//third_party/nss:nss_linux_config"
- }
- if (is_mac) {
- sources -= "bodge/secitem_array.c"
- }
-
-}
diff --git a/tools/gn/secondary/sdch/BUILD.gn b/tools/gn/secondary/sdch/BUILD.gn
index 9396624..ea36d0a 100644
--- a/tools/gn/secondary/sdch/BUILD.gn
+++ b/tools/gn/secondary/sdch/BUILD.gn
@@ -52,5 +52,5 @@ static_library("sdch") {
includes = [ "win" ]
}
- deps = [ "//third_party/zlib:chrome_zlib" ]
+ deps = [ "//third_party/zlib" ]
}
diff --git a/tools/gn/secondary/skia/BUILD.gn b/tools/gn/secondary/skia/BUILD.gn
index 7f16db3..e09221c 100644
--- a/tools/gn/secondary/skia/BUILD.gn
+++ b/tools/gn/secondary/skia/BUILD.gn
@@ -63,33 +63,22 @@ config("skia_config") {
}
}
-component("skia") {
- external = true
-
- deps = [
- ":skia_library",
- ":skia_chrome",
- ]
-
- direct_dependent_configs = [ ":skia_config" ]
-
- forward_dependent_configs_from = [
- ":skia_library",
- ":skia_chrome",
- ]
-
- #SKIA_IMPLEMENTATION=1
- # ["clang==1", {
- # "xcode_settings": {
- # "WARNING_CFLAGS!": [
- # # Don"t warn about string->bool used in asserts.
- # "-Wstring-conversion",
- # ],
- # },
- # "cflags!": [
- # "-Wstring-conversion",
- # ],
- # }],
+if (component_mode == "static_library") {
+ group("skia") {
+ deps = [
+ ":skia_library",
+ ":skia_chrome",
+ ]
+ forward_dependent_configs_from = deps
+ }
+} else {
+ shared_library("skia") {
+ deps = [
+ ":skia_library",
+ ":skia_chrome",
+ ":skia_common",
+ ]
+ }
}
config("skia_chrome_config") {
@@ -97,6 +86,7 @@ config("skia_chrome_config") {
}
static_library("skia_chrome") {
+ external = true
sources = [
"ext/analysis_canvas.cc",
"ext/analysis_canvas.h",
@@ -406,6 +396,7 @@ skia_gpu_sources = [
# TODO(brettw) finish this file.
static_library("skia_library") {
+ external = true
sources = [
# this should likely be moved into src/utils in skia
"//third_party/skia/src/core/SkFlate.cpp",
diff --git a/tools/gn/secondary/third_party/leveldatabase/BUILD.gn b/tools/gn/secondary/third_party/leveldatabase/BUILD.gn
index 8718a2d..dfab34b 100644
--- a/tools/gn/secondary/third_party/leveldatabase/BUILD.gn
+++ b/tools/gn/secondary/third_party/leveldatabase/BUILD.gn
@@ -20,6 +20,7 @@ config("leveldatabase_config") {
}
static_library("leveldatabase") {
+ external = true
sources = [
"env_chromium.cc",
"env_chromium.h",
diff --git a/tools/gn/secondary/third_party/libxml/BUILD.gn b/tools/gn/secondary/third_party/libxml/BUILD.gn
index 2a7a3de..6f027c8 100644
--- a/tools/gn/secondary/third_party/libxml/BUILD.gn
+++ b/tools/gn/secondary/third_party/libxml/BUILD.gn
@@ -147,7 +147,7 @@ static_library("libxml2") {
deps = [
"//third_party/icu:icuuc",
- "//third_party/zlib:chrome_zlib",
+ "//third_party/zlib",
]
if (is_linux) {
diff --git a/tools/gn/secondary/third_party/snappy/BUILD.gn b/tools/gn/secondary/third_party/snappy/BUILD.gn
index 81bfc14..578b455 100644
--- a/tools/gn/secondary/third_party/snappy/BUILD.gn
+++ b/tools/gn/secondary/third_party/snappy/BUILD.gn
@@ -67,6 +67,6 @@ test("snappy_unittest") {
":snappy",
"//base",
"//testing:gtest",
- "//third_party/zlib:chrome_zlib",
+ "//third_party/zlib",
]
}
diff --git a/tools/gn/secondary/third_party/zlib/BUILD.gn b/tools/gn/secondary/third_party/zlib/BUILD.gn
index 749043c..99e963e 100644
--- a/tools/gn/secondary/third_party/zlib/BUILD.gn
+++ b/tools/gn/secondary/third_party/zlib/BUILD.gn
@@ -6,8 +6,14 @@ config("zlib_config") {
includes = [ "." ]
}
-static_library("chrome_zlib") {
+static_library("zlib") {
external = true
+
+ if (!is_win) {
+ # Don't stomp on "libzlib" on other platforms.
+ output_name = "chrome_zlib"
+ }
+
sources = [
"adler32.c",
"compress.c",
@@ -70,7 +76,7 @@ static_library("minizip") {
cflags = [ "-Wno-parentheses-equality" ]
}
- deps = [ ":chrome_zlib" ]
+ deps = [ ":zlib" ]
direct_dependent_configs = [ ":zlib_config" ]
}
diff --git a/tools/gn/target.cc b/tools/gn/target.cc
index d51da55..487591f 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -191,8 +191,10 @@ void Target::PullDependentTargetInfo(std::set<const Config*>* unique_configs) {
inherited_libraries_.insert(dep);
// Inherited libraries and flags are inherited across static library
- // boundaries.
- if (dep->output_type() != SHARED_LIBRARY &&
+ // boundaries. For external targets, assume that the external_link_deps
+ // will take care of this.
+ if (!dep->external() &&
+ dep->output_type() != SHARED_LIBRARY &&
dep->output_type() != EXECUTABLE) {
const std::set<const Target*> inherited = dep->inherited_libraries();
for (std::set<const Target*>::const_iterator i = inherited.begin();