OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/toolchain/toolchain.gni") | 5 import("//build/toolchain/toolchain.gni") |
6 | 6 |
7 # This is used as the base template for both iOS and Mac frameworks.. | 7 # This is used as the base template for both iOS and Mac frameworks.. |
8 # | 8 # |
9 # Arguments | 9 # Arguments |
10 # | 10 # |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 deps += [ | 271 deps += [ |
272 ":$_executable_bundle_data", | 272 ":$_executable_bundle_data", |
273 ":$_info_plist_bundle_data", | 273 ":$_info_plist_bundle_data", |
274 ] | 274 ] |
275 | 275 |
276 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" | 276 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" |
277 bundle_resources_dir = "$bundle_root_dir/Resources" | 277 bundle_resources_dir = "$bundle_root_dir/Resources" |
278 bundle_executable_dir = "$bundle_root_dir/MacOS" | 278 bundle_executable_dir = "$bundle_root_dir/MacOS" |
279 } | 279 } |
280 } | 280 } |
| 281 |
| 282 # Template to package a loadable_module into a .plugin bundle. |
| 283 # |
| 284 # This takes no extra arguments that differ from a loadable_module. |
| 285 template("mac_plugin_bundle") { |
| 286 assert(defined(invoker.deps), |
| 287 "Dependencies must be specified for $target_name") |
| 288 |
| 289 _target_name = target_name |
| 290 _loadable_module_target = _target_name + "_loadable_module" |
| 291 _loadable_module_bundle_data = _loadable_module_target + "_bundle_data" |
| 292 |
| 293 loadable_module(_loadable_module_target) { |
| 294 visibility = [ ":$_loadable_module_bundle_data" ] |
| 295 forward_variables_from(invoker, |
| 296 "*", |
| 297 [ |
| 298 "assert_no_deps", |
| 299 "data_deps", |
| 300 "output_name", |
| 301 "visibility", |
| 302 ]) |
| 303 } |
| 304 |
| 305 bundle_data(_loadable_module_bundle_data) { |
| 306 visibility = [ ":$_target_name" ] |
| 307 sources = [ |
| 308 "$root_out_dir/${_loadable_module_target}.so", |
| 309 ] |
| 310 outputs = [ |
| 311 "{{bundle_executable_dir}}/$_target_name", |
| 312 ] |
| 313 public_deps = [ |
| 314 ":$_loadable_module_target", |
| 315 ] |
| 316 } |
| 317 |
| 318 create_bundle(_target_name) { |
| 319 forward_variables_from(invoker, |
| 320 [ |
| 321 "data_deps", |
| 322 "deps", |
| 323 "public_deps", |
| 324 "testonly", |
| 325 "visibility", |
| 326 ]) |
| 327 if (!defined(deps)) { |
| 328 deps = [] |
| 329 } |
| 330 deps += [ ":$_loadable_module_bundle_data" ] |
| 331 |
| 332 bundle_root_dir = "$root_out_dir/$_target_name.plugin/Contents" |
| 333 bundle_executable_dir = "$bundle_root_dir/MacOS" |
| 334 } |
| 335 } |
OLD | NEW |