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

Unified Diff: tools/gn/target.cc

Issue 565283002: GN: Add notion of 'complete' static libraries, akin to GYP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually process new argument. Duh. Created 6 years, 3 months 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/target.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target.cc
diff --git a/tools/gn/target.cc b/tools/gn/target.cc
index 592cceac8b4958239350f36f93d976984015ec4c..ba1e4b780610c995e49be094804a1d665c20290c 100644
--- a/tools/gn/target.cc
+++ b/tools/gn/target.cc
@@ -73,6 +73,7 @@ Target::Target(const Settings* settings, const Label& label)
output_type_(UNKNOWN),
all_headers_public_(true),
check_includes_(true),
+ complete_static_lib_(false),
testonly_(false),
hard_dep_(false),
toolchain_(NULL) {
@@ -160,6 +161,11 @@ bool Target::IsLinkable() const {
return output_type_ == STATIC_LIBRARY || output_type_ == SHARED_LIBRARY;
}
+bool Target::IsFinal() const {
+ return output_type_ == EXECUTABLE || output_type_ == SHARED_LIBRARY ||
+ (output_type_ == STATIC_LIBRARY && complete_static_lib_);
+}
+
std::string Target::GetComputedOutputName(bool include_prefix) const {
DCHECK(toolchain_)
<< "Toolchain must be specified before getting the computed output name.";
@@ -235,8 +241,7 @@ void Target::PullDependentTargetInfo() {
// Inherited libraries and flags are inherited across static library
// boundaries.
- if (dep->output_type() != SHARED_LIBRARY &&
- dep->output_type() != EXECUTABLE) {
+ if (!dep->IsFinal()) {
inherited_libraries_.Append(dep->inherited_libraries().begin(),
dep->inherited_libraries().end());
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698