Skip to content

Commit

Permalink
Add Objc.static_framework_file to fully link arguments
Browse files Browse the repository at this point in the history
When you are creating a fully linked static library that directly depends on static frameworks, you ideally want this framework to be linked, just as if it was an imported static library. Previously it would be silently ignored and you would have to distribute the static framework with the fully linked library. If users need the previous behavior they should use `avoid_deps` when creating the fully linked library.

Closes bazelbuild#16366.

PiperOrigin-RevId: 479580008
Change-Id: Ifff0ce7d2a591c4287b40a1afa18b501e269a87b
  • Loading branch information
keith authored and copybara-github committed Oct 7, 2022
1 parent d530d48 commit ccb2cc0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def _build_variable_extensions(
import_paths = []
for import_lib in objc_provider.imported_library.to_list():
import_paths.append(import_lib.path)
for static_framework_file in objc_provider.static_framework_file.to_list():
import_paths.append(static_framework_file.path)

extensions["objc_library_exec_paths"] = exclusively_objc_libs
extensions["cc_library_exec_paths"] = cc_libs.keys()
Expand Down Expand Up @@ -603,6 +605,7 @@ def _register_fully_link_action(common_variables, objc_provider, name):
linker_inputs.extend(objc_provider.flattened_objc_libraries())
linker_inputs.extend(objc_provider.flattened_cc_libraries())
linker_inputs.extend(objc_provider.imported_library.to_list())
linker_inputs.extend(objc_provider.static_framework_file.to_list())

return cc_common.link(
name = name,
Expand Down

0 comments on commit ccb2cc0

Please sign in to comment.