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

Unified Diff: utils/application_snapshot.gni

Issue 2871713002: Change build.py to be like ninja.py and only use a single GN/Ninja invocation to cross-build the SD… (Closed)
Patch Set: Created 3 years, 7 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 | « tools/gn.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/application_snapshot.gni
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni
index 9a317e291ecc31e597738f5755d062de978caa7a..03661fb49818efe7efc5850c4413abb2ca96a658 100644
--- a/utils/application_snapshot.gni
+++ b/utils/application_snapshot.gni
@@ -6,6 +6,12 @@ import("../build/compiled_action.gni")
_dart_root = get_path_info("..", "abspath")
+declare_args() {
+ # Default to building app-jit snapshots. The simulator and cross builds
+ # override this to script snapshots to cut down on build time.
+ dart_snapshot_kind = "app-jit"
+}
+
template("application_snapshot") {
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
assert(defined(invoker.training_args), "Must specify 'training_args'")
@@ -41,11 +47,18 @@ template("application_snapshot") {
abs_output = rebase_path(output)
main_file = rebase_path(main_dart)
- args = [
- "--packages=$dot_packages",
- "--snapshot=$abs_output",
- "--snapshot-kind=app-jit",
- main_file,
- ] + training_args
+ args = [ "--packages=$dot_packages",
+ "--snapshot=$abs_output" ]
+
+ if (dart_snapshot_kind == "script") {
+ args += ["--snapshot-kind=script",
+ main_file ]
+ assert(training_args != "", "Ignoring unused argument")
+ } else if (dart_snapshot_kind == "app-jit") {
+ args += ["--snapshot-kind=app-jit",
+ main_file ] + training_args
+ } else {
+ assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind")
+ }
}
}
« no previous file with comments | « tools/gn.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698