Vendor dependencies
Let's see how I like this workflow.
This commit is contained in:
parent
34d1830413
commit
9c435dc440
7500 changed files with 1665121 additions and 99 deletions
32
vendor/cxx/tools/buck/prelude/configurations/util.bzl
vendored
Normal file
32
vendor/cxx/tools/buck/prelude/configurations/util.bzl
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
#
|
||||
# This source code is licensed under both the MIT license found in the
|
||||
# LICENSE-MIT file in the root directory of this source tree and the Apache
|
||||
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
|
||||
# of this source tree.
|
||||
|
||||
def _configuration_info_union(infos):
|
||||
if len(infos) == 0:
|
||||
return ConfigurationInfo(
|
||||
constraints = {},
|
||||
values = {},
|
||||
)
|
||||
if len(infos) == 1:
|
||||
return infos[0]
|
||||
constraints = {k: v for info in infos for (k, v) in info.constraints.items()}
|
||||
values = {k: v for info in infos for (k, v) in info.values.items()}
|
||||
return ConfigurationInfo(
|
||||
constraints = constraints,
|
||||
values = values,
|
||||
)
|
||||
|
||||
def _constraint_values_to_configuration(values):
|
||||
return ConfigurationInfo(constraints = {
|
||||
info[ConstraintValueInfo].setting.label: info[ConstraintValueInfo]
|
||||
for info in values
|
||||
}, values = {})
|
||||
|
||||
util = struct(
|
||||
configuration_info_union = _configuration_info_union,
|
||||
constraint_values_to_configuration = _constraint_values_to_configuration,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue