Chromium Code Reviews| 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 | |
|
sdefresne
2016/04/18 09:02:58
nit: can you add visibility?
visibility = [ ":$_f
Robert Sesek
2016/04/18 15:13:09
Done.
| |
| 80 # and include_dirs to avoid duplicate values on the command-line. | |
| 81 common_flags = [ "-F" + rebase_path("$root_out_dir/.", root_out_dir) ] | |
| 82 cflags_objc = common_flags | |
| 83 cflags_objcc = common_flags | |
| 84 ldflags = common_flags | |
| 85 lib_dirs = [ root_out_dir ] | |
| 86 libs = [ _framework_name ] | |
| 87 } | |
| 88 | |
| 77 create_bundle(_framework_target) { | 89 create_bundle(_framework_target) { |
| 78 forward_variables_from(invoker, | 90 forward_variables_from(invoker, |
| 79 [ | 91 [ |
| 80 "data_deps", | 92 "data_deps", |
| 81 "deps", | 93 "deps", |
| 82 "public_deps", | 94 "public_deps", |
| 83 "testonly", | 95 "testonly", |
| 84 ]) | 96 ]) |
| 85 | 97 |
| 86 if (defined(_framework_version)) { | 98 if (defined(_framework_version)) { |
| 87 visibility = [ ":$_target_name" ] | 99 visibility = [ ":$_target_name" ] |
| 88 } else { | 100 } else { |
| 89 forward_variables_from(invoker, [ "visibility" ]) | 101 forward_variables_from(invoker, [ "visibility" ]) |
| 90 } | 102 } |
| 91 | 103 |
| 92 if (!defined(public_deps)) { | 104 if (!defined(public_deps)) { |
| 93 public_deps = [] | 105 public_deps = [] |
| 94 } | 106 } |
| 95 public_deps += [ ":$_shared_library_bundle_data" ] | 107 public_deps += [ ":$_shared_library_bundle_data" ] |
| 96 | 108 |
| 109 if (!defined(public_configs)) { | |
|
sdefresne
2016/04/18 09:02:58
You do not forward the public_configs in "forward_
Robert Sesek
2016/04/18 15:13:09
Done.
| |
| 110 public_configs = [] | |
| 111 } | |
| 112 public_configs += [ ":$_framework_public_config" ] | |
| 113 | |
| 97 bundle_root_dir = _framework_root_dir | 114 bundle_root_dir = _framework_root_dir |
| 98 bundle_resources_dir = "$bundle_root_dir/Resources" | 115 bundle_resources_dir = "$bundle_root_dir/Resources" |
| 99 bundle_executable_dir = "$bundle_root_dir" | 116 bundle_executable_dir = "$bundle_root_dir" |
| 100 } | 117 } |
| 101 | 118 |
| 102 if (defined(_framework_version)) { | 119 if (defined(_framework_version)) { |
| 103 action(_target_name) { | 120 action(_target_name) { |
| 104 forward_variables_from(invoker, | 121 forward_variables_from(invoker, |
| 105 [ | 122 [ |
| 106 "visibility", | 123 "visibility", |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 | 182 |
| 166 framework_bundle(target_name) { | 183 framework_bundle(target_name) { |
| 167 forward_variables_from(invoker, "*", [ "info_plist" ]) | 184 forward_variables_from(invoker, "*", [ "info_plist" ]) |
| 168 | 185 |
| 169 if (!defined(deps)) { | 186 if (!defined(deps)) { |
| 170 deps = [] | 187 deps = [] |
| 171 } | 188 } |
| 172 deps += [ ":$_info_plist_bundle_data" ] | 189 deps += [ ":$_info_plist_bundle_data" ] |
| 173 } | 190 } |
| 174 } | 191 } |
| OLD | NEW |