Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 import("//third_party/mojo/src/mojo/public/mojo_application.gni") | |
| 6 | |
| 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 | |
| 14 } else { | |
| 15 output_name = target_name | |
| 16 } | |
| 17 | |
| 18 mojo_deps = [] | |
| 19 if (defined(invoker.deps)) { | |
| 20 mojo_deps += invoker.deps | |
| 21 } | |
| 22 | |
| 23 if (defined(invoker.resources)) { | |
| 24 copy("copy_mandoline_resources") { | |
| 25 sources = invoker.resources | |
| 26 outputs = [ | |
| 27 "$root_out_dir/$output_name/resources/{{source_file_part}}", | |
| 28 ] | |
| 29 } | |
| 30 mojo_deps += [ ":copy_mandoline_resources" ] | |
|
Ben Goodger (Google)
2015/04/27 21:52:49
copy_mojo_application_resources??
| |
| 31 } | |
| 32 | |
| 33 mojo_native_application(output_name) { | |
| 34 output_name = invoker.target_name + "/" + invoker.target_name | |
| 35 | |
| 36 deps = mojo_deps | |
| 37 | |
| 38 if (defined(invoker.cflags)) { | |
| 39 cflags = invoker.cflags | |
| 40 } | |
| 41 if (defined(invoker.cflags_c)) { | |
| 42 cflags_c = invoker.cflags_c | |
| 43 } | |
| 44 if (defined(invoker.cflags_cc)) { | |
| 45 cflags_cc = invoker.cflags_cc | |
| 46 } | |
| 47 if (defined(invoker.cflags_objc)) { | |
| 48 cflags_objc = invoker.cflags_objc | |
| 49 } | |
| 50 if (defined(invoker.cflags_objcc)) { | |
| 51 cflags_objcc = invoker.cflags_objcc | |
| 52 } | |
| 53 if (defined(invoker.defines)) { | |
| 54 defines = invoker.defines | |
| 55 } | |
| 56 if (defined(invoker.include_dirs)) { | |
| 57 include_dirs = invoker.include_dirs | |
| 58 } | |
| 59 if (defined(invoker.ldflags)) { | |
| 60 ldflags = invoker.ldflags | |
| 61 } | |
| 62 if (defined(invoker.lib_dirs)) { | |
| 63 lib_dirs = invoker.lib_dirs | |
| 64 } | |
| 65 if (defined(invoker.libs)) { | |
| 66 libs = invoker.libs | |
| 67 } | |
| 68 if (defined(invoker.data_deps)) { | |
| 69 data_deps = invoker.data_deps | |
| 70 } | |
| 71 if (defined(invoker.forward_dependent_configs_from)) { | |
| 72 forward_dependent_configs_from = invoker.forward_dependent_configs_from | |
| 73 } | |
| 74 if (defined(invoker.public_deps)) { | |
| 75 public_deps = invoker.public_deps | |
| 76 } | |
| 77 if (defined(invoker.all_dependent_configs)) { | |
| 78 all_dependent_configs = invoker.all_dependent_configs | |
| 79 } | |
| 80 if (defined(invoker.public_configs)) { | |
| 81 public_configs = invoker.public_configs | |
| 82 } | |
| 83 if (defined(invoker.check_includes)) { | |
| 84 check_includes = invoker.check_includes | |
| 85 } | |
| 86 if (defined(invoker.configs)) { | |
| 87 configs = invoker.configs | |
| 88 } | |
| 89 if (defined(invoker.data)) { | |
| 90 data = invoker.data | |
| 91 } | |
| 92 if (defined(invoker.inputs)) { | |
| 93 inputs = invoker.inputs | |
| 94 } | |
| 95 if (defined(invoker.public)) { | |
| 96 public = invoker.public | |
| 97 } | |
| 98 if (defined(invoker.sources)) { | |
| 99 sources = invoker.sources | |
| 100 } | |
| 101 if (defined(invoker.testonly)) { | |
| 102 testonly = invoker.testonly | |
| 103 } | |
| 104 } | |
| 105 } | |
| OLD | NEW |