| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/module_args/mojo.gni") | 5 import("//build/module_args/mojo.gni") |
| 6 import("mojo.gni") | 6 import("mojo.gni") |
| 7 import("mojo_sdk.gni") | 7 import("mojo_sdk.gni") |
| 8 | 8 |
| 9 # Generate a binary mojo application.The parameters of this template are those | 9 # Generate a binary mojo application.The parameters of this template are those |
| 10 # of a shared library. | 10 # of a shared library. |
| 11 template("mojo_native_application") { | 11 template("mojo_native_application") { |
| 12 if (defined(invoker.output_name)) { | 12 if (defined(invoker.output_name)) { |
| 13 base_target_name = invoker.output_name | 13 base_target_name = invoker.output_name |
| 14 } else { | 14 } else { |
| 15 base_target_name = target_name | 15 base_target_name = target_name |
| 16 } | 16 } |
| 17 | 17 |
| 18 final_target_name = target_name | 18 final_target_name = target_name |
| 19 | 19 |
| 20 if (!is_nacl) { | 20 if (!is_nacl) { |
| 21 output = base_target_name + ".mojo" | 21 output = base_target_name + ".mojo" |
| 22 library_target_name = base_target_name + "_library" | 22 library_target_name = base_target_name + "_library" |
| 23 copy_symbols_target = "__${final_target_name}_copy_symbols" |
| 23 | 24 |
| 24 if (is_linux || is_android) { | 25 if (is_linux || is_android) { |
| 25 library_name = "lib${library_target_name}.so" | 26 library_name = "lib${library_target_name}.so" |
| 26 } else if (is_win) { | 27 } else if (is_win) { |
| 27 library_name = "${library_target_name}.dll" | 28 library_name = "${library_target_name}.dll" |
| 28 } else if (is_mac || is_ios) { | 29 } else if (is_mac || is_ios) { |
| 29 library_name = "lib${library_target_name}.dylib" | 30 library_name = "lib${library_target_name}.dylib" |
| 30 } else { | 31 } else { |
| 31 assert(false, "Platform not supported.") | 32 assert(false, "Platform not supported.") |
| 32 } | 33 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (defined(invoker.public)) { | 124 if (defined(invoker.public)) { |
| 124 public = invoker.public | 125 public = invoker.public |
| 125 } | 126 } |
| 126 if (defined(invoker.sources)) { | 127 if (defined(invoker.sources)) { |
| 127 sources = invoker.sources | 128 sources = invoker.sources |
| 128 } | 129 } |
| 129 if (defined(invoker.testonly)) { | 130 if (defined(invoker.testonly)) { |
| 130 testonly = invoker.testonly | 131 testonly = invoker.testonly |
| 131 } | 132 } |
| 132 | 133 |
| 134 visibility = [ |
| 135 ":${final_target_name}", |
| 136 ":${copy_symbols_target}", |
| 137 ] |
| 138 } |
| 139 |
| 140 copy(copy_symbols_target) { |
| 141 if (defined(invoker.testonly)) { |
| 142 testonly = invoker.testonly |
| 143 } |
| 133 visibility = [ ":${final_target_name}" ] | 144 visibility = [ ":${final_target_name}" ] |
| 145 deps = [ |
| 146 ":${library_target_name}", |
| 147 ] |
| 148 |
| 149 sources = [ |
| 150 "${root_out_dir}/${library_name}", |
| 151 ] |
| 152 outputs = [ |
| 153 "${root_out_dir}/symbols/${library_name}", |
| 154 ] |
| 134 } | 155 } |
| 135 | 156 |
| 136 copy(final_target_name) { | 157 copy(final_target_name) { |
| 137 if (defined(invoker.testonly)) { | 158 if (defined(invoker.testonly)) { |
| 138 testonly = invoker.testonly | 159 testonly = invoker.testonly |
| 139 } | 160 } |
| 140 if (defined(invoker.visibility)) { | 161 if (defined(invoker.visibility)) { |
| 141 visibility = invoker.visibility | 162 visibility = invoker.visibility |
| 142 } | 163 } |
| 143 deps = [ | 164 deps = [ |
| 144 ":${library_target_name}", | 165 ":${library_target_name}", |
| 166 ":${copy_symbols_target}", |
| 145 ] | 167 ] |
| 146 | 168 |
| 147 sources = [ | 169 sources = [ |
| 148 "${library_dir}/${library_name}", | 170 "${library_dir}/${library_name}", |
| 149 ] | 171 ] |
| 150 outputs = [ | 172 outputs = [ |
| 151 "${root_out_dir}/${output}", | 173 "${root_out_dir}/${output}", |
| 152 ] | 174 ] |
| 153 } | 175 } |
| 154 } else { | 176 } else { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 "--output=$rebase_output", | 386 "--output=$rebase_output", |
| 365 "--line=#!mojo mojo:android_handler", | 387 "--line=#!mojo mojo:android_handler", |
| 366 ] | 388 ] |
| 367 | 389 |
| 368 public_deps = [ | 390 public_deps = [ |
| 369 ":$zip_action_name", | 391 ":$zip_action_name", |
| 370 ] | 392 ] |
| 371 } | 393 } |
| 372 } | 394 } |
| 373 } | 395 } |
| OLD | NEW |