from pathlib import Path


def guard_name_project_plus_name(filename: str, project_name: str):
    """
    Create a header guard name composed of a project name the filename.

    Parameters
    ----------
    filename : str
        The name of the file containing the header guard
    project_name : str
        The name of the C++ project to add to the header guard

    Returns
    -------
    str
        The header guard
    """
    path = Path(filename)
    if project_name:
        return f"{project_name}_{path.stem}_H".upper()
    return f"{path.stem}_H".upper()