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") {
12 if (defined(invoker.output_name)) {
13 output_name = invoker.output_name
15 output_name = target_name
19 if (defined(invoker.deps)) {
20 mojo_deps += invoker.deps
23 if (defined(invoker.resources)) {
24 copy("copy_mojo_application_resources") {
25 sources = invoker.resources
27 "$root_out_dir/$output_name/resources/{{source_file_part}}",
30 mojo_deps += [ ":copy_mojo_application_resources" ]
33 mojo_native_application(output_name) {
34 output_name = invoker.target_name + "/" + invoker.target_name
38 if (defined(invoker.cflags)) {
39 cflags = invoker.cflags
41 if (defined(invoker.cflags_c)) {
42 cflags_c = invoker.cflags_c
44 if (defined(invoker.cflags_cc)) {
45 cflags_cc = invoker.cflags_cc
47 if (defined(invoker.cflags_objc)) {
48 cflags_objc = invoker.cflags_objc
50 if (defined(invoker.cflags_objcc)) {
51 cflags_objcc = invoker.cflags_objcc
53 if (defined(invoker.defines)) {
54 defines = invoker.defines
56 if (defined(invoker.include_dirs)) {
57 include_dirs = invoker.include_dirs
59 if (defined(invoker.ldflags)) {
60 ldflags = invoker.ldflags
62 if (defined(invoker.lib_dirs)) {
63 lib_dirs = invoker.lib_dirs
65 if (defined(invoker.libs)) {
68 if (defined(invoker.data_deps)) {
69 data_deps = invoker.data_deps
71 if (defined(invoker.forward_dependent_configs_from)) {
72 forward_dependent_configs_from = invoker.forward_dependent_configs_from
74 if (defined(invoker.public_deps)) {
75 public_deps = invoker.public_deps
77 if (defined(invoker.all_dependent_configs)) {
78 all_dependent_configs = invoker.all_dependent_configs
80 if (defined(invoker.public_configs)) {
81 public_configs = invoker.public_configs
83 if (defined(invoker.check_includes)) {
84 check_includes = invoker.check_includes
86 if (defined(invoker.configs)) {
87 configs = invoker.configs
89 if (defined(invoker.data)) {
92 if (defined(invoker.inputs)) {
93 inputs = invoker.inputs
95 if (defined(invoker.public)) {
96 public = invoker.public
98 if (defined(invoker.sources)) {
99 sources = invoker.sources
101 if (defined(invoker.testonly)) {
102 testonly = invoker.testonly