Chromium Code Reviews| Index: mandoline/mandoline_application.gni |
| diff --git a/mandoline/mandoline_application.gni b/mandoline/mandoline_application.gni |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6b767099770b77630ea5aecaf0aca0dbaa7246e7 |
| --- /dev/null |
| +++ b/mandoline/mandoline_application.gni |
| @@ -0,0 +1,106 @@ |
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import("//third_party/mojo/src/mojo/public/mojo_application.gni") |
| + |
| +# Mandoline applications are mojo applications with resources. Mandoline |
| +# applications create a directory named output_name with the following |
| +# contents: |
| +# output_name.mojo : the shared library |
| +# resources : resources |
| +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.
|
| + if (defined(invoker.output_name)) { |
| + output_name = invoker.output_name |
| + } else { |
| + output_name = target_name |
| + } |
| + |
| + mojo_deps = [] |
| + if (defined(invoker.deps)) { |
| + mojo_deps += invoker.deps |
| + } |
| + |
| + if (defined(invoker.resources)) { |
| + copy("copy_mandoline_resources") { |
| + sources = invoker.resources |
| + outputs = [ |
| + "$root_out_dir/$output_name/resources/{{source_file_part}}", |
| + ] |
| + } |
| + mojo_deps += [ ":copy_mandoline_resources" ] |
| + } |
| + |
| + mojo_native_application(output_name) { |
| + output_name = invoker.target_name + "/" + invoker.target_name |
| + |
| + deps = mojo_deps |
| + |
| + if (defined(invoker.cflags)) { |
| + cflags = invoker.cflags |
| + } |
| + if (defined(invoker.cflags_c)) { |
| + cflags_c = invoker.cflags_c |
| + } |
| + if (defined(invoker.cflags_cc)) { |
| + cflags_cc = invoker.cflags_cc |
| + } |
| + if (defined(invoker.cflags_objc)) { |
| + cflags_objc = invoker.cflags_objc |
| + } |
| + if (defined(invoker.cflags_objcc)) { |
| + cflags_objcc = invoker.cflags_objcc |
| + } |
| + if (defined(invoker.defines)) { |
| + defines = invoker.defines |
| + } |
| + if (defined(invoker.include_dirs)) { |
| + include_dirs = invoker.include_dirs |
| + } |
| + if (defined(invoker.ldflags)) { |
| + ldflags = invoker.ldflags |
| + } |
| + if (defined(invoker.lib_dirs)) { |
| + lib_dirs = invoker.lib_dirs |
| + } |
| + if (defined(invoker.libs)) { |
| + libs = invoker.libs |
| + } |
| + if (defined(invoker.data_deps)) { |
| + data_deps = invoker.data_deps |
| + } |
| + if (defined(invoker.forward_dependent_configs_from)) { |
| + forward_dependent_configs_from = invoker.forward_dependent_configs_from |
| + } |
| + if (defined(invoker.public_deps)) { |
| + public_deps = invoker.public_deps |
| + } |
| + if (defined(invoker.all_dependent_configs)) { |
| + all_dependent_configs = invoker.all_dependent_configs |
| + } |
| + if (defined(invoker.public_configs)) { |
| + public_configs = invoker.public_configs |
| + } |
| + if (defined(invoker.check_includes)) { |
| + check_includes = invoker.check_includes |
| + } |
| + if (defined(invoker.configs)) { |
| + configs = invoker.configs |
| + } |
| + if (defined(invoker.data)) { |
| + data = invoker.data |
| + } |
| + if (defined(invoker.inputs)) { |
| + inputs = invoker.inputs |
| + } |
| + if (defined(invoker.public)) { |
| + public = invoker.public |
| + } |
| + if (defined(invoker.sources)) { |
| + sources = invoker.sources |
| + } |
| + if (defined(invoker.testonly)) { |
| + testonly = invoker.testonly |
| + } |
| + } |
| +} |