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

Unified Diff: build/config/android/internal_rules.gni

Issue 2161063003: 🎫 Fail write_build_config.py if current_toolchain != default_toolchain (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: put back _java target removed from test() Created 4 years, 5 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 | « build/android/gyp/write_build_config.py ('k') | device/vr/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 194c494ff19aa9c51f5657d49245cadad18cc7f6..23641507f1931bdc7080f81384221baae789a915 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -336,6 +336,25 @@ template("write_build_config") {
rebase_path(invoker.bundled_srcjars, root_build_dir)
args += [ "--bundled-srcjars=$_rebased_bundled_srcjars" ]
}
+ if (current_toolchain != default_toolchain) {
+ # This has to be a built-time error rather than a GN assert because many
+ # packages have a mix of java and non-java targets. For example, the
+ # following would fail even though nothing depends on :bar(//baz):
+ #
+ # shared_library("foo") {
+ # }
+ #
+ # android_library("bar") {
+ # deps = [ ":foo(//baz)" ]
+ # assert(current_toolchain == default_toolchain)
+ # }
+ _msg = [
+ "Tried to build an Android target in a non-default toolchain.",
+ "target: " + get_label_info(":$target_name", "label_with_toolchain"),
+ "default_toolchain: $default_toolchain",
+ ]
+ args += [ "--fail=$_msg" ]
+ }
}
}
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | device/vr/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698