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