Commit 8e48d18 1 parent 3427a0c commit 8e48d18 Copy full SHA for 8e48d18
File tree 1 file changed +24
-1
lines changed
1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 28
28
# of these change. If inputs is empty, the step will run only when the
29
29
# binary itself changes.
30
30
#
31
+ # prefix_with_time_cmd (optional)
32
+ # [bool] If true, the command will be prefixed with "time" to measure the
33
+ # time, CPU and memory usage of the tool, i.e. "time <command>" with
34
+ # appropriate arguments for the current platform.
35
+ #
31
36
# visibility
32
37
# deps
33
38
# args (all optional)
@@ -127,9 +132,27 @@ template("compiled_action") {
127
132
depfile = invoker .depfile
128
133
}
129
134
135
+ args = []
136
+ if (defined (invoker .prefix_with_time_cmd ) && invoker .prefix_with_time_cmd ) {
137
+ if (host_os == " linux" ) {
138
+ args += [
139
+ " time" ,
140
+ " -v" ,
141
+ ]
142
+ } else if (host_os == " mac" ) {
143
+ args += [
144
+ " time" ,
145
+ " -l" ,
146
+ ]
147
+ } else {
148
+ print (" Warning: prefix_with_time_cmd is not supported on Windows." )
149
+ }
150
+ }
151
+
130
152
# The script takes as arguments the binary to run, and then the arguments
131
153
# to pass it.
132
- args = [ rebase_path (host_executable , root_build_dir ) ] + invoker .args
154
+ args += [ rebase_path (host_executable , root_build_dir ) ]
155
+ args += invoker .args
133
156
}
134
157
}
135
158
You can’t perform that action at this time.
0 commit comments