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/mac/base_rules.gni") | 5 import("//build/config/mac/base_rules.gni") |
6 | 6 |
7 # Generates Info.plist files for Mac apps and frameworks. | 7 # Generates Info.plist files for Mac apps and frameworks. |
8 # | 8 # |
9 # Arguments | 9 # Arguments |
10 # | 10 # |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 # Template to create a Mac executable application bundle. | 157 # Template to create a Mac executable application bundle. |
158 # | 158 # |
159 # Arguments | 159 # Arguments |
160 # | 160 # |
161 # info_plist: | 161 # info_plist: |
162 # string, path to the Info.plist file that will be used for the bundle. | 162 # string, path to the Info.plist file that will be used for the bundle. |
163 # | 163 # |
164 # output_name: | 164 # output_name: |
165 # (optional) string, name of the generated app without the | 165 # (optional) string, name of the generated app without the |
166 # .app suffix. If omitted, defaults to target_name. | 166 # .app suffix. If omitted, defaults to target_name. |
| 167 # |
| 168 # extra_configs: |
| 169 # (optional) list of label, additional configs to apply to the |
| 170 # executable target. |
167 template("mac_app_bundle") { | 171 template("mac_app_bundle") { |
168 assert(defined(invoker.info_plist), | 172 assert(defined(invoker.info_plist), |
169 "The Info.plist file must be specified for $target_name") | 173 "The Info.plist file must be specified for $target_name") |
170 | 174 |
171 _target_name = target_name | 175 _target_name = target_name |
172 _output_name = target_name | 176 _output_name = target_name |
173 if (defined(invoker.output_name)) { | 177 if (defined(invoker.output_name)) { |
174 _output_name = invoker.output_name | 178 _output_name = invoker.output_name |
175 } | 179 } |
176 | 180 |
177 _executable_target = target_name + "_executable" | 181 _executable_target = target_name + "_executable" |
178 _executable_bundle_data = _executable_target + "_bundle_data" | 182 _executable_bundle_data = _executable_target + "_bundle_data" |
179 | 183 |
180 executable(_executable_target) { | 184 executable(_executable_target) { |
181 visibility = [ ":$_executable_bundle_data" ] | 185 visibility = [ ":$_executable_bundle_data" ] |
182 forward_variables_from(invoker, | 186 forward_variables_from(invoker, |
183 "*", | 187 "*", |
184 [ | 188 [ |
185 "assert_no_deps", | 189 "assert_no_deps", |
186 "data_deps", | 190 "data_deps", |
187 "info_plist", | 191 "info_plist", |
188 "output_name", | 192 "output_name", |
189 "visibility", | 193 "visibility", |
190 ]) | 194 ]) |
| 195 if (defined(extra_configs)) { |
| 196 configs += extra_configs |
| 197 } |
191 output_name = _output_name | 198 output_name = _output_name |
192 output_dir = "$target_out_dir/$_executable_target" | 199 output_dir = "$target_out_dir/$_executable_target" |
193 } | 200 } |
194 | 201 |
195 bundle_data(_executable_bundle_data) { | 202 bundle_data(_executable_bundle_data) { |
196 visibility = [ ":$_target_name" ] | 203 visibility = [ ":$_target_name" ] |
197 forward_variables_from(invoker, [ "testonly" ]) | 204 forward_variables_from(invoker, [ "testonly" ]) |
198 sources = [ | 205 sources = [ |
199 "$target_out_dir/$_executable_target/$_output_name", | 206 "$target_out_dir/$_executable_target/$_output_name", |
200 ] | 207 ] |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 ]) | 311 ]) |
305 if (!defined(deps)) { | 312 if (!defined(deps)) { |
306 deps = [] | 313 deps = [] |
307 } | 314 } |
308 deps += [ ":$_loadable_module_bundle_data" ] | 315 deps += [ ":$_loadable_module_bundle_data" ] |
309 | 316 |
310 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" | 317 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" |
311 bundle_executable_dir = "$bundle_root_dir/MacOS" | 318 bundle_executable_dir = "$bundle_root_dir/MacOS" |
312 } | 319 } |
313 } | 320 } |
OLD | NEW |