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

Unified Diff: BUILD.gn

Issue 1739603002: Move GN directory name assert into //BUILD.gn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | build/config/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 5956fa4c671574ec55b74966ec7dbd1d399ee48a..29b94428e7ce43ef084c39d477d7ccdd568dabef 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -873,3 +873,29 @@ group("chromium_builder_perf") {
}
}
}
+
+# Because of the source assignment filter, many targets end up over-filtering
+# their sources if the output directory contains a platform name. Assert that
+# this doesn't happen. http://crbug.com/548283
+template("assert_valid_out_dir") {
+ # List copied from //build/config/BUILDCONFIG.gn.
+ set_sources_assignment_filter([
+ "*\bandroid/*",
+ "*\bchromeos/*",
+ "*\bcocoa/*",
+ "*\bios/*",
+ "*\blinux/*",
+ "*\bmac/*",
+ "*\bposix/*",
+ "*\bwin/*",
+ ])
+ assert(target_name != "") # Mark as used.
+ sources = invoker.actual_sources
+ assert(
+ sources == invoker.actual_sources,
+ "Do not use a platform name in your output directory (found \"$root_build_dir\"). http://crbug.com/548283")
+}
+
+assert_valid_out_dir("_unused") {
+ actual_sources = [ "$root_build_dir/foo" ]
+}
« no previous file with comments | « no previous file | build/config/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698