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

Unified Diff: tools/gn/target_unittest.cc

Issue 582863002: GN: Complete static libs can't depend on static libs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: tools/gn/target_unittest.cc
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index 151cb31f5549f57bc9fe663303626d5e1fc3310b..a8f031bc3582be1364ad54c680e8fc95a992451f 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -225,6 +225,27 @@ TEST(Target, InheritCompleteStaticLib) {
EXPECT_TRUE(a_inherited.IndexOf(&b) != static_cast<size_t>(-1));
}
+TEST(Target, InheritCompleteStaticLibNoStaticLibDeps) {
+ TestWithScope setup;
+ Err err;
+
+ // Create a dependency chain:
+ // A (complete static lib) -> B (static lib)
+ Target a(setup.settings(), Label(SourceDir("//foo/"), "a"));
+ a.set_output_type(Target::STATIC_LIBRARY);
+ a.visibility().SetPublic();
+ a.set_complete_static_lib(true);
+ a.SetToolchain(setup.toolchain());
+ Target b(setup.settings(), Label(SourceDir("//foo/"), "b"));
+ b.set_output_type(Target::STATIC_LIBRARY);
+ b.visibility().SetPublic();
+ b.SetToolchain(setup.toolchain());
+
+ a.public_deps().push_back(LabelTargetPair(&b));
+ ASSERT_TRUE(b.OnResolved(&err));
+ ASSERT_FALSE(a.OnResolved(&err));
+}
+
TEST(Target, GetComputedOutputName) {
TestWithScope setup;
Err err;
« tools/gn/target.cc ('K') | « tools/gn/target.cc ('k') | tools/gn/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698