2
0
Fork 0
mirror of https://github.com/bazelbuild/rules_cc synced 2024-11-30 22:41:22 +00:00
rules_cc/cc/toolchains/impl/args_utils.bzl
Googler c5493f9b2c BEGIN_PUBLIC
Implement cc_action_type_config.

Rename it from cc_action_config, to make it clear that we are not configuring an action, but rather configuring a type of action.
END_PUBLIC

PiperOrigin-RevId: 610518142
Change-Id: Ic10755952ee786d30a3a5564aa09a8dc16499f3a
2024-02-26 13:58:42 -08:00

31 lines
1.1 KiB
Python

# Copyright 2024 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""."""
def get_action_type(args_list, action_type):
"""Returns the corresponding entry in ArgsListInfo.by_action.
Args:
args_list: (ArgsListInfo) The args list to look through
action_type: (ActionTypeInfo) The action type to look up.
Returns:
The information corresponding to this action type.
"""
for args in args_list.by_action:
if args.action == action_type:
return args
return struct(action = action_type, args = tuple(), files = depset([]))