def __get_target(flag_iterator, details):
    """
    This function consumes --target or -target flag which is followed by the
    compilation target architecture.
    This target might be different from the default compilation target
    collected from the compiler if cross compilation is done for
    another target.
    This is then collected to the buildaction object.
    """
    if flag_iterator.item in ['--target', '-target']:
        next(flag_iterator)
        details['compilation_target'] = flag_iterator.item
        return True

    return False