Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: tools/gn/lib_file.cc

Issue 1530183005: Special-case paths that appear in libs by not prefixing them with -l. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in previous patch Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/lib_file.h ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/lib_file.cc
diff --git a/tools/gn/lib_file.cc b/tools/gn/lib_file.cc
new file mode 100644
index 0000000000000000000000000000000000000000..86eacb29c1299801001e5897d0be4a9bd2bfa0c3
--- /dev/null
+++ b/tools/gn/lib_file.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 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.
+
+#include "tools/gn/lib_file.h"
+
+#include "base/logging.h"
+
+LibFile::LibFile() {}
+
+LibFile::LibFile(const SourceFile& source_file) : source_file_(source_file) {}
+
+LibFile::LibFile(const base::StringPiece& lib_name)
+ : name_(lib_name.data(), lib_name.size()) {
+ DCHECK(!lib_name.empty());
+}
+
+void LibFile::Swap(LibFile* other) {
+ name_.swap(other->name_);
+ source_file_.swap(other->source_file_);
+}
+
+const std::string& LibFile::value() const {
+ return is_source_file() ? source_file_.value() : name_;
+}
+
+const SourceFile& LibFile::source_file() const {
+ DCHECK(is_source_file());
+ return source_file_;
+}
« no previous file with comments | « tools/gn/lib_file.h ('k') | tools/gn/ninja_binary_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698