OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/toolchain/toolchain.gni") | 5 import("//build/toolchain/toolchain.gni") |
6 import("mojo.gni") | |
7 | 6 |
8 # Generate a binary Mojo application in a self-named directory. | 7 # Generate a binary Mojo application in a self-named directory. |
9 # Application resources are copied to a "resources" directory alongside the app. | 8 # Application resources are copied to a "resources" directory alongside the app. |
10 # The parameters of this template are those of a shared library. | 9 # The parameters of this template are those of a shared library. |
11 template("mojo_native_application") { | 10 template("mojo_native_application") { |
12 base_target_name = target_name | 11 base_target_name = target_name |
13 if (defined(invoker.output_name)) { | 12 if (defined(invoker.output_name)) { |
14 base_target_name = invoker.output_name | 13 base_target_name = invoker.output_name |
15 } | 14 } |
16 | 15 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 data_deps = [] | 75 data_deps = [] |
77 if (!defined(invoker.avoid_runner_cycle) || !invoker.avoid_runner_cycle) { | 76 if (!defined(invoker.avoid_runner_cycle) || !invoker.avoid_runner_cycle) { |
78 # Give the user an out; as some mojo services are depended on by the | 77 # Give the user an out; as some mojo services are depended on by the |
79 # runner. | 78 # runner. |
80 data_deps += [ "//mojo/runner:mojo_runner" ] | 79 data_deps += [ "//mojo/runner:mojo_runner" ] |
81 } | 80 } |
82 if (defined(invoker.data_deps)) { | 81 if (defined(invoker.data_deps)) { |
83 data_deps += invoker.data_deps | 82 data_deps += invoker.data_deps |
84 } | 83 } |
85 | 84 |
86 # Copy any necessary prebuilt artifacts. | 85 deps = [ |
87 if (mojo_use_prebuilt_mojo_shell) { | 86 "//mojo/platform_handle:for_shared_library", |
88 data_deps += | 87 "//mojo/public/gles2:for_shared_library", |
89 [ rebase_path("mojo/public/tools:copy_mojo_shell", ".", mojo_root) ] | 88 "//mojo/public/c/system:for_shared_library", |
90 } | 89 ] |
91 if (mojo_use_prebuilt_network_service) { | |
92 data_deps += [ rebase_path("mojo/public/tools:copy_network_service", | |
93 ".", | |
94 mojo_root) ] | |
95 } | |
96 | |
97 deps = rebase_path([ | |
98 "mojo/public/gles2:for_shared_library", | |
99 "mojo/public/c/system:for_shared_library", | |
100 ], | |
101 ".", | |
102 mojo_root) | |
103 deps += [ "//mojo/platform_handle:for_shared_library" ] | |
104 | 90 |
105 deps += mojo_deps | 91 deps += mojo_deps |
106 if (defined(invoker.public_deps)) { | 92 if (defined(invoker.public_deps)) { |
107 public_deps = invoker.public_deps | 93 public_deps = invoker.public_deps |
108 } | 94 } |
109 if (defined(invoker.all_dependent_configs)) { | 95 if (defined(invoker.all_dependent_configs)) { |
110 all_dependent_configs = invoker.all_dependent_configs | 96 all_dependent_configs = invoker.all_dependent_configs |
111 } | 97 } |
112 if (defined(invoker.public_configs)) { | 98 if (defined(invoker.public_configs)) { |
113 public_configs = invoker.public_configs | 99 public_configs = invoker.public_configs |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 179 } |
194 if (defined(invoker.libs)) { | 180 if (defined(invoker.libs)) { |
195 libs = invoker.libs | 181 libs = invoker.libs |
196 } | 182 } |
197 | 183 |
198 data_deps = [] | 184 data_deps = [] |
199 if (defined(invoker.data_deps)) { | 185 if (defined(invoker.data_deps)) { |
200 data_deps = invoker.data_deps | 186 data_deps = invoker.data_deps |
201 } | 187 } |
202 | 188 |
203 # Copy any necessary prebuilt artifacts. | 189 deps = [ |
204 if (mojo_use_prebuilt_mojo_shell) { | 190 "//mojo/public/c/system", |
205 data_deps += | 191 "//mojo/public/platform/nacl:system", |
206 [ rebase_path("mojo/public/tools:copy_mojo_shell", ".", mojo_root) ] | 192 ] |
207 } | |
208 if (mojo_use_prebuilt_network_service) { | |
209 data_deps += [ rebase_path("mojo/public/tools:copy_network_service", | |
210 ".", | |
211 mojo_root) ] | |
212 } | |
213 | 193 |
214 deps = rebase_path([ | |
215 "mojo/public/c/system", | |
216 "mojo/public/platform/nacl:system", | |
217 ], | |
218 ".", | |
219 mojo_root) | |
220 deps += mojo_deps | 194 deps += mojo_deps |
221 if (defined(invoker.public_deps)) { | 195 if (defined(invoker.public_deps)) { |
222 public_deps = invoker.public_deps | 196 public_deps = invoker.public_deps |
223 } | 197 } |
224 if (defined(invoker.all_dependent_configs)) { | 198 if (defined(invoker.all_dependent_configs)) { |
225 all_dependent_configs = invoker.all_dependent_configs | 199 all_dependent_configs = invoker.all_dependent_configs |
226 } | 200 } |
227 if (defined(invoker.public_configs)) { | 201 if (defined(invoker.public_configs)) { |
228 public_configs = invoker.public_configs | 202 public_configs = invoker.public_configs |
229 } | 203 } |
(...skipping 23 matching lines...) Expand all Loading... |
253 } | 227 } |
254 | 228 |
255 action(target_name) { | 229 action(target_name) { |
256 if (defined(invoker.testonly)) { | 230 if (defined(invoker.testonly)) { |
257 testonly = invoker.testonly | 231 testonly = invoker.testonly |
258 } | 232 } |
259 if (defined(invoker.visibility)) { | 233 if (defined(invoker.visibility)) { |
260 visibility = invoker.visibility | 234 visibility = invoker.visibility |
261 } | 235 } |
262 | 236 |
263 script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_root) | 237 script = "//mojo/public/tools/prepend.py" |
264 | 238 |
265 input_path = "${root_out_dir}/${nexe_name}" | 239 input_path = "${root_out_dir}/${nexe_name}" |
266 inputs = [ | 240 inputs = [ |
267 input_path, | 241 input_path, |
268 ] | 242 ] |
269 | 243 |
270 output_path = "${root_build_dir}/${base_target_name}/${output}" | 244 output_path = "${root_build_dir}/${base_target_name}/${output}" |
271 outputs = [ | 245 outputs = [ |
272 output_path, | 246 output_path, |
273 ] | 247 ] |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 } | 328 } |
355 if (defined(invoker.public_deps)) { | 329 if (defined(invoker.public_deps)) { |
356 public_deps = invoker.public_deps | 330 public_deps = invoker.public_deps |
357 } | 331 } |
358 if (defined(invoker.data_deps)) { | 332 if (defined(invoker.data_deps)) { |
359 data_deps = invoker.data_deps | 333 data_deps = invoker.data_deps |
360 } | 334 } |
361 } | 335 } |
362 | 336 |
363 action(target_name) { | 337 action(target_name) { |
364 script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_root) | 338 script = "//mojo/public/tools/prepend.py" |
365 | 339 |
366 base_target_name = target_name | 340 base_target_name = target_name |
367 if (defined(invoker.output_name)) { | 341 if (defined(invoker.output_name)) { |
368 base_target_name = invoker.output_name | 342 base_target_name = invoker.output_name |
369 } | 343 } |
370 | 344 |
371 input = zip_action_output | 345 input = zip_action_output |
372 inputs = [ | 346 inputs = [ |
373 input, | 347 input, |
374 ] | 348 ] |
(...skipping 12 matching lines...) Expand all Loading... |
387 ] | 361 ] |
388 | 362 |
389 deps = mojo_deps | 363 deps = mojo_deps |
390 | 364 |
391 public_deps = [ | 365 public_deps = [ |
392 ":$zip_action_name", | 366 ":$zip_action_name", |
393 ] | 367 ] |
394 } | 368 } |
395 } | 369 } |
396 } | 370 } |
OLD | NEW |