| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 "$target_out_dir/$_shared_library_target/$_output_name", | 67 "$target_out_dir/$_shared_library_target/$_output_name", |
| 68 ] | 68 ] |
| 69 outputs = [ | 69 outputs = [ |
| 70 "{{bundle_executable_dir}}/$_output_name", | 70 "{{bundle_executable_dir}}/$_output_name", |
| 71 ] | 71 ] |
| 72 public_deps = [ | 72 public_deps = [ |
| 73 ":$_shared_library_target", | 73 ":$_shared_library_target", |
| 74 ] | 74 ] |
| 75 } | 75 } |
| 76 | 76 |
| 77 _framework_public_config = _target_name + "_public_config" |
| 78 config(_framework_public_config) { |
| 79 # TODO(sdefresne): should we have a framework_dirs similar to lib_dirs |
| 80 # and include_dirs to avoid duplicate values on the command-line. |
| 81 visibility = [ ":$_framework_target" ] |
| 82 common_flags = [ "-F" + rebase_path("$root_out_dir/.", root_out_dir) ] |
| 83 cflags_objc = common_flags |
| 84 cflags_objcc = common_flags |
| 85 ldflags = common_flags |
| 86 lib_dirs = [ root_out_dir ] |
| 87 libs = [ _framework_name ] |
| 88 } |
| 89 |
| 77 create_bundle(_framework_target) { | 90 create_bundle(_framework_target) { |
| 78 forward_variables_from(invoker, | 91 forward_variables_from(invoker, |
| 79 [ | 92 [ |
| 80 "data_deps", | 93 "data_deps", |
| 81 "deps", | 94 "deps", |
| 82 "public_deps", | 95 "public_deps", |
| 83 "testonly", | 96 "testonly", |
| 84 ]) | 97 ]) |
| 85 | 98 |
| 86 if (defined(_framework_version)) { | 99 if (defined(_framework_version)) { |
| 87 visibility = [ ":$_target_name" ] | 100 visibility = [ ":$_target_name" ] |
| 88 } else { | 101 } else { |
| 89 forward_variables_from(invoker, [ "visibility" ]) | 102 forward_variables_from(invoker, [ "visibility" ]) |
| 90 } | 103 } |
| 91 | 104 |
| 92 if (!defined(public_deps)) { | 105 if (!defined(public_deps)) { |
| 93 public_deps = [] | 106 public_deps = [] |
| 94 } | 107 } |
| 95 public_deps += [ ":$_shared_library_bundle_data" ] | 108 public_deps += [ ":$_shared_library_bundle_data" ] |
| 96 | 109 |
| 110 public_configs = [ ":$_framework_public_config" ] |
| 111 |
| 97 bundle_root_dir = _framework_root_dir | 112 bundle_root_dir = _framework_root_dir |
| 98 bundle_resources_dir = "$bundle_root_dir/Resources" | 113 bundle_resources_dir = "$bundle_root_dir/Resources" |
| 99 bundle_executable_dir = "$bundle_root_dir" | 114 bundle_executable_dir = "$bundle_root_dir" |
| 100 } | 115 } |
| 101 | 116 |
| 102 if (defined(_framework_version)) { | 117 if (defined(_framework_version)) { |
| 103 action(_target_name) { | 118 action(_target_name) { |
| 104 forward_variables_from(invoker, | 119 forward_variables_from(invoker, |
| 105 [ | 120 [ |
| 106 "visibility", | 121 "visibility", |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 deps += [ | 271 deps += [ |
| 257 ":$_executable_bundle_data", | 272 ":$_executable_bundle_data", |
| 258 ":$_info_plist_bundle_data", | 273 ":$_info_plist_bundle_data", |
| 259 ] | 274 ] |
| 260 | 275 |
| 261 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" | 276 bundle_root_dir = "$root_out_dir/${_output_name}.app/Contents" |
| 262 bundle_resources_dir = "$bundle_root_dir/Resources" | 277 bundle_resources_dir = "$bundle_root_dir/Resources" |
| 263 bundle_executable_dir = "$bundle_root_dir/MacOS" | 278 bundle_executable_dir = "$bundle_root_dir/MacOS" |
| 264 } | 279 } |
| 265 } | 280 } |
| OLD | NEW |