xref: /aosp_15_r20/external/bazelbuild-rules_rust/wasm_bindgen/private/transitions.bzl (revision d4726bddaa87cc4778e7472feed243fa4b6c267f)
1*d4726bddSHONG Yifan"""Transition implementations for wasm-bindgen rust Rules"""
2*d4726bddSHONG Yifan
3*d4726bddSHONG Yifandef _wasm_bindgen_transition(_settings, _attr):
4*d4726bddSHONG Yifan    """The implementation of the `wasm_bindgen_transition` transition
5*d4726bddSHONG Yifan
6*d4726bddSHONG Yifan    Args:
7*d4726bddSHONG Yifan        _settings (dict): A dict {String:Object} of all settings declared
8*d4726bddSHONG Yifan            in the inputs parameter to `transition()`
9*d4726bddSHONG Yifan        _attr (dict): A dict of attributes and values of the rule to which
10*d4726bddSHONG Yifan            the transition is attached
11*d4726bddSHONG Yifan
12*d4726bddSHONG Yifan    Returns:
13*d4726bddSHONG Yifan        dict: A dict of new build settings values to apply
14*d4726bddSHONG Yifan    """
15*d4726bddSHONG Yifan    return {"//command_line_option:platforms": str(Label("//rust/platform:wasm"))}
16*d4726bddSHONG Yifan
17*d4726bddSHONG Yifanwasm_bindgen_transition = transition(
18*d4726bddSHONG Yifan    implementation = _wasm_bindgen_transition,
19*d4726bddSHONG Yifan    inputs = [],
20*d4726bddSHONG Yifan    outputs = ["//command_line_option:platforms"],
21*d4726bddSHONG Yifan)
22