Adjust c archive example for modern linker input API.

This commit is contained in:
Benjamin Peterson 2020-10-26 20:31:47 -05:00
parent b2f6e22c34
commit 8994fb0fe1
1 changed files with 11 additions and 6 deletions

View File

@ -30,14 +30,19 @@ def _my_c_archive_impl(ctx):
unsupported_features = ctx.disabled_features, unsupported_features = ctx.disabled_features,
) )
library_to_link = cc_common.create_library_to_link( linker_input = cc_common.create_linker_input(
actions = ctx.actions, owner = ctx.label,
feature_configuration = feature_configuration, libraries = depset(direct = [
cc_toolchain = cc_toolchain, cc_common.create_library_to_link(
static_library = output_file, actions = ctx.actions,
feature_configuration = feature_configuration,
cc_toolchain = cc_toolchain,
static_library = output_file,
),
]),
) )
compilation_context = cc_common.create_compilation_context() compilation_context = cc_common.create_compilation_context()
linking_context = cc_common.create_linking_context(libraries_to_link = [library_to_link]) linking_context = cc_common.create_linking_context(linker_inputs = depset(direct = [linker_input]))
archiver_path = cc_common.get_tool_for_action( archiver_path = cc_common.get_tool_for_action(
feature_configuration = feature_configuration, feature_configuration = feature_configuration,