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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 if (defined(invoker.output_name)) { | 251 if (defined(invoker.output_name)) { |
252 _output_name = invoker.output_name | 252 _output_name = invoker.output_name |
253 } | 253 } |
254 | 254 |
255 # If the framework is unversioned, the final _target_name will be the | 255 # If the framework is unversioned, the final _target_name will be the |
256 # create_bundle(_framework_target), otherwise an action with the name | 256 # create_bundle(_framework_target), otherwise an action with the name |
257 # _target_name will depends on the the create_bundle() in order to prepare | 257 # _target_name will depends on the the create_bundle() in order to prepare |
258 # the versioned directory structure. | 258 # the versioned directory structure. |
259 _framework_target = _target_name | 259 _framework_target = _target_name |
260 _framework_name = _output_name + ".framework" | 260 _framework_name = _output_name + ".framework" |
261 _framework_root_dir = "$root_out_dir/$_framework_name" | 261 _framework_base_dir = "$root_out_dir/$_framework_name" |
262 if (defined(invoker.framework_version) && invoker.framework_version != "") { | 262 if (defined(invoker.framework_version) && invoker.framework_version != "") { |
263 _framework_version = invoker.framework_version | 263 _framework_version = invoker.framework_version |
264 _framework_root_dir += "/Versions/$_framework_version" | 264 _framework_root_dir = _framework_base_dir + "/Versions/$_framework_version" |
265 _framework_target = _target_name + "_create_bundle" | 265 _framework_target = _target_name + "_create_bundle" |
| 266 } else { |
| 267 _framework_root_dir = _framework_base_dir |
266 } | 268 } |
267 | 269 |
268 _link_shared_library_target = target_name + "_shared_library" | 270 _link_shared_library_target = target_name + "_shared_library" |
269 _shared_library_bundle_data = target_name + "_shared_library_bundle_data" | 271 _shared_library_bundle_data = target_name + "_shared_library_bundle_data" |
270 | 272 |
271 shared_library(_link_shared_library_target) { | 273 shared_library(_link_shared_library_target) { |
272 forward_variables_from(invoker, | 274 forward_variables_from(invoker, |
273 "*", | 275 "*", |
274 [ | 276 [ |
275 "assert_no_deps", | 277 "assert_no_deps", |
(...skipping 19 matching lines...) Expand all Loading... |
295 "$target_out_dir/$_link_shared_library_target/$_output_name", | 297 "$target_out_dir/$_link_shared_library_target/$_output_name", |
296 ] | 298 ] |
297 outputs = [ | 299 outputs = [ |
298 "{{bundle_executable_dir}}/$_output_name", | 300 "{{bundle_executable_dir}}/$_output_name", |
299 ] | 301 ] |
300 public_deps = [ | 302 public_deps = [ |
301 ":$_link_shared_library_target", | 303 ":$_link_shared_library_target", |
302 ] | 304 ] |
303 } | 305 } |
304 | 306 |
| 307 # Clean the entire framework if the framework_version changes. |
| 308 _version_arg = "" |
| 309 if (defined(_framework_version)) { |
| 310 _version_arg = _framework_version |
| 311 } |
| 312 _version_file = "$target_out_dir/${target_name}_version" |
| 313 exec_script("//build/config/mac/prepare_framework_version.py", |
| 314 [ |
| 315 rebase_path(_version_file), |
| 316 rebase_path(_framework_base_dir), |
| 317 "'$_version_arg'", |
| 318 ]) |
| 319 |
305 _framework_public_config = _target_name + "_public_config" | 320 _framework_public_config = _target_name + "_public_config" |
306 config(_framework_public_config) { | 321 config(_framework_public_config) { |
307 # TODO(sdefresne): should we have a framework_dirs similar to lib_dirs | 322 # TODO(sdefresne): should we have a framework_dirs similar to lib_dirs |
308 # and include_dirs to avoid duplicate values on the command-line. | 323 # and include_dirs to avoid duplicate values on the command-line. |
309 visibility = [ ":$_framework_target" ] | 324 visibility = [ ":$_framework_target" ] |
310 ldflags = [ | 325 ldflags = [ |
311 "-F", | 326 "-F", |
312 rebase_path("$root_out_dir/.", root_build_dir), | 327 rebase_path("$root_out_dir/.", root_build_dir), |
313 ] | 328 ] |
314 lib_dirs = [ root_out_dir ] | 329 lib_dirs = [ root_out_dir ] |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 ]) | 647 ]) |
633 if (!defined(deps)) { | 648 if (!defined(deps)) { |
634 deps = [] | 649 deps = [] |
635 } | 650 } |
636 deps += [ ":$_loadable_module_bundle_data" ] | 651 deps += [ ":$_loadable_module_bundle_data" ] |
637 | 652 |
638 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" | 653 bundle_root_dir = "$root_out_dir/$_output_name.plugin/Contents" |
639 bundle_executable_dir = "$bundle_root_dir/MacOS" | 654 bundle_executable_dir = "$bundle_root_dir/MacOS" |
640 } | 655 } |
641 } | 656 } |
OLD | NEW |