summaryrefslogtreecommitdiffstats
path: root/BUILD.gn
diff options
context:
space:
mode:
authoragrieve <agrieve@chromium.org>2016-02-29 12:15:06 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-29 20:16:59 +0000
commit017b91f136d3d2d18b703bbeee63326423699676 (patch)
treecab517e0c2555a90af6eab364a7be458f5778596 /BUILD.gn
parent074a7d782e8cd5b83801df6c7e112e7f39c0b74e (diff)
downloadchromium_src-017b91f136d3d2d18b703bbeee63326423699676.zip
chromium_src-017b91f136d3d2d18b703bbeee63326423699676.tar.gz
chromium_src-017b91f136d3d2d18b703bbeee63326423699676.tar.bz2
Move GN directory name assert into //BUILD.gn
This way it will be sure to be the first thing that fails, rather than only sometimes. BUG=548283 Review URL: https://codereview.chromium.org/1739603002 Cr-Commit-Position: refs/heads/master@{#378255}
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn26
1 files changed, 26 insertions, 0 deletions
diff --git a/BUILD.gn b/BUILD.gn
index c013d45..58eb32f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -880,3 +880,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" ]
+}