def _build_option_macro_name(config_key: str) -> str:
    """Build macro name for configuration key.

    All configuration variables require a macro name, so that they can be referenced in a header file.
    Some values in config define "macro_name", some don't. This helps generate consistent macro names
    for the latter.
    """
    sanitised_config_key = config_key.replace(".", "_").replace("-", "_").upper()
    return f"MBED_CONF_{sanitised_config_key}"