1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//third_party/mojo/src/mojo/public/mojo_application.gni")
7 # Used for mojo applications that have resources. This creates a directory
8 # named output_name with the following contents:
9 # output_name.mojo : the shared library
10 # resources : resources
11 template("mojo_application_package") {
13 if (defined(invoker.deps)) {
14 mojo_deps += invoker.deps
17 if (defined(invoker.resources)) {
18 output_name = target_name
19 if (defined(invoker.output_name)) {
20 output_name = invoker.output_name
23 copy_step_name = "${target_name}__copy_resources"
24 copy(copy_step_name) {
25 sources = invoker.resources
27 "$root_out_dir/$output_name/resources/{{source_file_part}}",
29 if (defined(invoker.testonly)) {
30 testonly = invoker.testonly
34 mojo_deps += [ ":$copy_step_name" ]
37 mojo_native_application(target_name) {
38 output_name = invoker.target_name
39 if (defined(invoker.output_name)) {
40 output_name = invoker.output_name
42 output_name = output_name + "/" + output_name
46 if (defined(invoker.cflags)) {
47 cflags = invoker.cflags
49 if (defined(invoker.cflags_c)) {
50 cflags_c = invoker.cflags_c
52 if (defined(invoker.cflags_cc)) {
53 cflags_cc = invoker.cflags_cc
55 if (defined(invoker.cflags_objc)) {
56 cflags_objc = invoker.cflags_objc
58 if (defined(invoker.cflags_objcc)) {
59 cflags_objcc = invoker.cflags_objcc
61 if (defined(invoker.defines)) {
62 defines = invoker.defines
64 if (defined(invoker.include_dirs)) {
65 include_dirs = invoker.include_dirs
67 if (defined(invoker.ldflags)) {
68 ldflags = invoker.ldflags
70 if (defined(invoker.lib_dirs)) {
71 lib_dirs = invoker.lib_dirs
73 if (defined(invoker.libs)) {
76 if (defined(invoker.data_deps)) {
77 data_deps = invoker.data_deps
79 if (defined(invoker.forward_dependent_configs_from)) {
80 forward_dependent_configs_from = invoker.forward_dependent_configs_from
82 if (defined(invoker.public_deps)) {
83 public_deps = invoker.public_deps
85 if (defined(invoker.all_dependent_configs)) {
86 all_dependent_configs = invoker.all_dependent_configs
88 if (defined(invoker.public_configs)) {
89 public_configs = invoker.public_configs
91 if (defined(invoker.check_includes)) {
92 check_includes = invoker.check_includes
94 if (defined(invoker.configs)) {
95 configs = invoker.configs
97 if (defined(invoker.data)) {
100 if (defined(invoker.inputs)) {
101 inputs = invoker.inputs
103 if (defined(invoker.public)) {
104 public = invoker.public
106 if (defined(invoker.sources)) {
107 sources = invoker.sources
109 if (defined(invoker.testonly)) {
110 testonly = invoker.testonly