Skip to content

Commit

Permalink
Get Objc compile info from CcCompilationContext
Browse files Browse the repository at this point in the history
Note strict includes still come from ObjcProvider.

Step 2 of 3-step plan:
1. Migrate the definitions.
2. Migrate the uses.
3. Delete old ObjcProvider definitions.

See bazelbuild/bazel#10674.

RELNOTES: None
PiperOrigin-RevId: 307965879
  • Loading branch information
googlewalt authored and swiple-rules-gardener committed Apr 23, 2020
1 parent 7eee6cc commit 8b51a1b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions swift/internal/compiling.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ def _dependencies_clang_defines_configurator(prerequisites, args):
"""Adds C/C++ dependencies' preprocessor defines to the command line."""
all_clang_defines = depset(transitive = [
prerequisites.cc_info.compilation_context.defines,
prerequisites.objc_info.define,
])
args.add_all(all_clang_defines, before_each = "-Xcc", format_each = "-D%s")

Expand Down Expand Up @@ -600,7 +599,6 @@ def _dependencies_clang_modules_configurator(prerequisites, args):
# should not include its headers in the inputs.
header_depsets = [
prerequisites.cc_info.compilation_context.headers,
prerequisites.objc_info.header,
prerequisites.objc_info.umbrella_header,
]

Expand All @@ -614,9 +612,8 @@ def _dependencies_clang_modules_configurator(prerequisites, args):
def _framework_search_paths_configurator(prerequisites, args):
"""Add search paths for prebuilt frameworks to the command line."""
args.add_all(
prerequisites.objc_info.framework_search_path_only,
prerequisites.cc_info.compilation_context.framework_includes,
format_each = "-F%s",
map_each = paths.dirname,
)

def _static_frameworks_disable_autolink_configurator(prerequisites, args):
Expand Down Expand Up @@ -722,7 +719,7 @@ def _conditional_compilation_flag_configurator(prerequisites, args):
prerequisites.transitive_defines,
# Take any Swift-compatible defines from Objective-C dependencies
# and define them for Swift.
prerequisites.objc_info.define,
prerequisites.cc_info.compilation_context.defines,
],
)
args.add_all(
Expand Down Expand Up @@ -1326,7 +1323,7 @@ def _merge_targets_providers(supports_objc_interop, targets):
if apple_common.Objc in target and supports_objc_interop:
objc_infos.append(target[apple_common.Objc])
objc_include_paths_workaround_depsets.append(
target[apple_common.Objc].include,
target[apple_common.Objc].strict_include,
)

return struct(
Expand Down

0 comments on commit 8b51a1b

Please sign in to comment.