Skip to content

Commit

Permalink
Bazel 4 update, move away from ObjcProvider deprecated fields
Browse files Browse the repository at this point in the history
Those fields has been moved to CcCompilationContext per bazelbuild/bazel#10674
  • Loading branch information
efyx authored and efyx committed Mar 16, 2021
1 parent 94bbe00 commit 49e04a3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions aspects.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ def get_compile_flags(dep):
quote_include = "."
options.append("-iquote {}".format(quote_include))

for framework_include in compilation_context.framework_includes.to_list():
options.append("-F\"{}\"".format(framework_include))

return options

def _cc_compiler_info(ctx, target, srcs, feature_configuration, cc_toolchain):
Expand Down Expand Up @@ -213,13 +216,8 @@ def _objc_compiler_info(ctx, target, srcs, feature_configuration, cc_toolchain):
),
)

defines = ["-D\"{}\"".format(val) for val in target.objc.define.to_list()]
includes = ["-I{}".format(val) for val in target.objc.include.to_list()]
system_includes = ["-isystem {}".format(val) for val in target.objc.include_system.to_list()]
iquotes = ["-iquote {}".format(val) for val in target.objc.iquote.to_list()]
frameworks = (["-F {}/..".format(val) for val in target.objc.static_framework_paths.to_list()] +
["-F {}/..".format(val) for val in target.objc.dynamic_framework_paths.to_list()] +
["-F {}/..".format(val) for val in target.objc.framework_search_path_only.to_list()])
["-F {}/..".format(val) for val in target.objc.dynamic_framework_paths.to_list()])

xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig]

Expand All @@ -238,10 +236,6 @@ def _objc_compiler_info(ctx, target, srcs, feature_configuration, cc_toolchain):
["-F {}/Developer/Library/Frameworks".format(platform_root)] +
# FIXME this needs to be done per-file to be fully correct
["-fobjc-arc"] +
defines +
includes +
iquotes +
system_includes +
frameworks +
(ctx.rule.attr.copts if "copts" in dir(ctx.rule.attr) else []))

Expand Down

0 comments on commit 49e04a3

Please sign in to comment.