Skip to content

Commit

Permalink
Migrate user_link_flags API usage for `--incompatible_require_linke…
Browse files Browse the repository at this point in the history
…r_input_cc_api`

See also bazelbuild/bazel#10860

PiperOrigin-RevId: 567131072
Change-Id: I6e48160a91fbb3821359d37cfc78e46be260b589
  • Loading branch information
ahumesky authored and JiaYan Lin committed Jan 23, 2024
1 parent f1454ee commit dc7574c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rules/native_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,16 @@ def _link_native_deps_if_present(ctx, cc_info, cc_toolchain, build_config, actua
build_config.bin_dir,
)

link_opts = cc_info.linking_context.user_link_flags
linker_inputs = cc_info.linking_context.linker_inputs.to_list()

link_opts = []
for linker_input in linker_inputs:
for flag in linker_input.user_link_flags:
link_opts.append(flag)

linkstamps = []
for input in cc_info.linking_context.linker_inputs.to_list():
linkstamps.extend(input.linkstamps)
for linker_input in linker_inputs:
linkstamps.extend(linker_input.linkstamps)
linkstamps_dict = {linkstamp: None for linkstamp in linkstamps}

build_info_artifacts = _get_build_info(ctx) if linkstamps_dict else []
Expand Down

0 comments on commit dc7574c

Please sign in to comment.