def _get_output_file_idx(build_args):
    """
        Get the index of output file from build args
    :param build_args: arguments of gcc
    :return: index in the build args where output file is.
    """
    i = 0
    while i < len(build_args):
        if build_args[i] == "-o":
            return i + 1
        i += 1
    return -1