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 # Mandoline applications are mojo applications with resources. Mandoline | |
| 8 # applications create a directory named output_name with the following | |
| 9 # contents: | |
| 10 # output_name.mojo : the shared library | |
| 11 # resources : resources | |
| 12 template("mandoline_native_application") { | |
|
Ben Goodger (Google)
2015/04/27 21:30:03
Can we put this in mojo and call it mojo_applicati
sky
2015/04/27 21:35:33
Done.
| |
| 13 if (defined(invoker.output_name)) { | |
| 14 output_name = invoker.output_name | |
| 15 } else { | |
| 16 output_name = target_name | |
| 17 } | |
| 18 | |
| 19 mojo_deps = [] | |
| 20 if (defined(invoker.deps)) { | |
| 21 mojo_deps += invoker.deps | |
| 22 } | |
| 23 | |
| 24 if (defined(invoker.resources)) { | |
| 25 copy("copy_mandoline_resources") { | |
| 26 sources = invoker.resources | |
| 27 outputs = [ | |
| 28 "$root_out_dir/$output_name/resources/{{source_file_part}}", | |
| 29 ] | |
| 30 } | |
| 31 mojo_deps += [ ":copy_mandoline_resources" ] | |
| 32 } | |
| 33 | |
| 34 mojo_native_application(output_name) { | |
| 35 output_name = invoker.target_name + "/" + invoker.target_name | |
| 36 | |
| 37 deps = mojo_deps | |
| 38 | |
| 39 if (defined(invoker.cflags)) { | |
| 40 cflags = invoker.cflags | |
| 41 } | |
| 42 if (defined(invoker.cflags_c)) { | |
| 43 cflags_c = invoker.cflags_c | |
| 44 } | |
| 45 if (defined(invoker.cflags_cc)) { | |
| 46 cflags_cc = invoker.cflags_cc | |
| 47 } | |
| 48 if (defined(invoker.cflags_objc)) { | |
| 49 cflags_objc = invoker.cflags_objc | |
| 50 } | |
| 51 if (defined(invoker.cflags_objcc)) { | |
| 52 cflags_objcc = invoker.cflags_objcc | |
| 53 } | |
| 54 if (defined(invoker.defines)) { | |
| 55 defines = invoker.defines | |
| 56 } | |
| 57 if (defined(invoker.include_dirs)) { | |
| 58 include_dirs = invoker.include_dirs | |
| 59 } | |
| 60 if (defined(invoker.ldflags)) { | |
| 61 ldflags = invoker.ldflags | |
| 62 } | |
| 63 if (defined(invoker.lib_dirs)) { | |
| 64 lib_dirs = invoker.lib_dirs | |
| 65 } | |
| 66 if (defined(invoker.libs)) { | |
| 67 libs = invoker.libs | |
| 68 } | |
| 69 if (defined(invoker.data_deps)) { | |
| 70 data_deps = invoker.data_deps | |
| 71 } | |
| 72 if (defined(invoker.forward_dependent_configs_from)) { | |
| 73 forward_dependent_configs_from = invoker.forward_dependent_configs_from | |
| 74 } | |
| 75 if (defined(invoker.public_deps)) { | |
| 76 public_deps = invoker.public_deps | |
| 77 } | |
| 78 if (defined(invoker.all_dependent_configs)) { | |
| 79 all_dependent_configs = invoker.all_dependent_configs | |
| 80 } | |
| 81 if (defined(invoker.public_configs)) { | |
| 82 public_configs = invoker.public_configs | |
| 83 } | |
| 84 if (defined(invoker.check_includes)) { | |
| 85 check_includes = invoker.check_includes | |
| 86 } | |
| 87 if (defined(invoker.configs)) { | |
| 88 configs = invoker.configs | |
| 89 } | |
| 90 if (defined(invoker.data)) { | |
| 91 data = invoker.data | |
| 92 } | |
| 93 if (defined(invoker.inputs)) { | |
| 94 inputs = invoker.inputs | |
| 95 } | |
| 96 if (defined(invoker.public)) { | |
| 97 public = invoker.public | |
| 98 } | |
| 99 if (defined(invoker.sources)) { | |
| 100 sources = invoker.sources | |
| 101 } | |
| 102 if (defined(invoker.testonly)) { | |
| 103 testonly = invoker.testonly | |
| 104 } | |
| 105 } | |
| 106 } | |
| OLD | NEW |