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/config/ios/ios_sdk.gni") | 5 import("//build/config/ios/ios_sdk.gni") |
6 import("//build/config/mac/rules.gni") | 6 import("//build/config/mac/rules.gni") |
7 | 7 |
8 # TODO(crbug.com/297668): refactor this template to extract common behaviour | 8 # TODO(crbug.com/297668): refactor this template to extract common behaviour |
9 # between OS X and iOS bundle generation, then create a generic "app" template | 9 # between OS X and iOS bundle generation, then create a generic "app" template |
10 # that forward to "executable" on all platform except iOS/OS X. | 10 # that forward to "executable" on all platform except iOS/OS X. |
11 | 11 |
12 # Template to build an application bundle for iOS. | 12 # Template to build an application bundle for iOS. |
13 # | 13 # |
14 # This should be used instead of "executable" built-in target type on iOS. | 14 # This should be used instead of "executable" built-in target type on iOS. |
15 # As the template forward the generation of the application executable to | 15 # As the template forward the generation of the application executable to |
16 # an "executable" target, all arguments supported by "executable" targets | 16 # an "executable" target, all arguments supported by "executable" targets |
17 # are also supported by this template. | 17 # are also supported by this template. |
brettw
2016/04/21 20:27:55
Can you carefully document the behavior here, list
Robert Sesek
2016/04/22 15:27:06
I added this to the base framework_bundle docs sin
| |
18 # | 18 # |
19 # Arguments | 19 # Arguments |
20 # | 20 # |
21 # output_name: | 21 # output_name: |
22 # (optional) string, name of the generated application, if omitted, | 22 # (optional) string, name of the generated application, if omitted, |
23 # defaults to the target_name. | 23 # defaults to the target_name. |
24 # | 24 # |
25 # extra_substitutions: | 25 # extra_substitutions: |
26 # (optional) list of string in "key=value" format, each value will | 26 # (optional) list of string in "key=value" format, each value will |
27 # be used as an additional variable substitution rule when generating | 27 # be used as an additional variable substitution rule when generating |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 | 325 |
326 group(_framework_headers_target) { | 326 group(_framework_headers_target) { |
327 deps = [ | 327 deps = [ |
328 ":$_compile_headers_map_target", | 328 ":$_compile_headers_map_target", |
329 ":$_copy_public_headers_target", | 329 ":$_copy_public_headers_target", |
330 ":$_create_module_map_target", | 330 ":$_create_module_map_target", |
331 ] | 331 ] |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 _framework_public_config = _target_name + "_ios_public_config" | |
336 config(_framework_public_config) { | |
337 visibility = [ ":$_framework_public_config" ] | |
338 if (defined(_public_headers)) { | |
339 common_flags = [ "-F" + rebase_path("$root_out_dir/.", root_out_dir) ] | |
340 cflags_objc = common_flags | |
341 cflags_objcc = common_flags | |
342 } | |
343 | |
344 # The link settings are inherited from the framework_bundle config. | |
345 } | |
346 | |
335 framework_bundle(_framework_target) { | 347 framework_bundle(_framework_target) { |
336 forward_variables_from(invoker, | 348 forward_variables_from(invoker, |
337 "*", | 349 "*", |
338 [ | 350 [ |
339 "output_name", | 351 "output_name", |
340 "public_headers", | 352 "public_headers", |
341 "visibility", | 353 "visibility", |
342 ]) | 354 ]) |
343 output_name = _output_name | 355 output_name = _output_name |
344 | 356 |
357 if (!defined(public_configs)) { | |
358 public_configs = [] | |
359 } | |
360 public_configs += [ ":$_framework_public_config" ] | |
361 | |
345 if (defined(_public_headers)) { | 362 if (defined(_public_headers)) { |
346 visibility = [ ":$_target_name" ] | 363 visibility = [ |
364 ":$_target_name", | |
365 ":$_target_name+link", | |
366 ] | |
347 configs += [ ":$_headers_map_config" ] | 367 configs += [ ":$_headers_map_config" ] |
348 | 368 |
349 if (!defined(deps)) { | 369 if (!defined(deps)) { |
350 deps = [] | 370 deps = [] |
351 } | 371 } |
352 deps += [ ":$_framework_headers_target" ] | 372 deps += [ ":$_framework_headers_target" ] |
353 } else { | 373 } else { |
354 forward_variables_from(invoker, [ "visibility" ]) | 374 if (defined(invoker.visibility)) { |
375 visibility = invoker.visibility | |
376 visibility += [ ":$_target_name+link" ] | |
377 } | |
355 } | 378 } |
356 } | 379 } |
357 | 380 |
358 if (defined(_public_headers)) { | 381 if (defined(_public_headers)) { |
359 group(_target_name) { | 382 group(_target_name) { |
360 forward_variables_from(invoker, | 383 forward_variables_from(invoker, |
361 [ | 384 [ |
362 "testonly", | 385 "testonly", |
363 "visibility", | |
364 "public_configs", | 386 "public_configs", |
365 ]) | 387 ]) |
366 | 388 |
389 if (defined(invoker.visibility)) { | |
390 visibility = invoker.visibility | |
391 visibility += [ ":$_target_name+link" ] | |
392 } | |
393 | |
367 public_deps = [ | 394 public_deps = [ |
368 ":$_framework_target", | 395 ":$_framework_target", |
369 ] | 396 ] |
370 } | 397 } |
398 | |
399 group(_target_name + "+link") { | |
400 forward_variables_from(invoker, | |
401 [ | |
402 "testonly", | |
403 "visibility", | |
404 ]) | |
405 public_deps = [ | |
406 ":$_framework_target+link", | |
407 ] | |
408 } | |
371 } | 409 } |
372 } | 410 } |
OLD | NEW |