From 8994fb0fe1daf21212049d71c578c5089678527b Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 26 Oct 2020 20:31:47 -0500 Subject: [PATCH] Adjust c archive example for modern linker input API. --- examples/my_c_archive/my_c_archive.bzl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/my_c_archive/my_c_archive.bzl b/examples/my_c_archive/my_c_archive.bzl index 476fdd6..86cebe9 100644 --- a/examples/my_c_archive/my_c_archive.bzl +++ b/examples/my_c_archive/my_c_archive.bzl @@ -30,14 +30,19 @@ def _my_c_archive_impl(ctx): unsupported_features = ctx.disabled_features, ) - library_to_link = cc_common.create_library_to_link( - actions = ctx.actions, - feature_configuration = feature_configuration, - cc_toolchain = cc_toolchain, - static_library = output_file, + linker_input = cc_common.create_linker_input( + owner = ctx.label, + libraries = depset(direct = [ + cc_common.create_library_to_link( + actions = ctx.actions, + feature_configuration = feature_configuration, + cc_toolchain = cc_toolchain, + static_library = output_file, + ), + ]), ) 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( feature_configuration = feature_configuration,