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

Unified Diff: build/config/BUILD.gn

Issue 1704563003: Add a GN assert that output dir doesn't have a platform name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: delete explicit filter 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/BUILD.gn
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index abd6c2f09d97144ac1b22973600d040ba3392238..5197304a6eeb4f63e7241bd540632f105b12208f 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -27,6 +27,21 @@ declare_args() {
dcheck_always_on = false
}
+# 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") {
+ assert(target_name != "") # Mark as used.
+ assert(
+ invoker.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("_check_output_dir_has_no_platform_name") {
+ actual_sources = [ "$root_build_dir/foo" ]
+ sources = actual_sources
+}
+
# TODO(brettw) Most of these should be removed. Instead of global feature
# flags, we should have more modular flags that apply only to a target and its
# dependents. For example, depending on the "x11" meta-target should define
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698