Allow tcc arguments to be read from @listfiles

From: Vlad Vissoultchev
    Date: Tue, 12 Apr 2016 20:43:15 +0300
    Subject: Allow tcc arguments to be read from @listfiles

    This allows all @ prefixed arguments to be treated as listfiles
    containing list of source files or tcc options where each one is on a
    separate line. Can be used to benchmark compilation speed with
    non-trivial amount of source files.

    The impl of `tcc_parse_args` had to be moved to a new function that is
    able to be called recursively w/ the original one remaining as a driver
    of the new one. Listfiles parsing happens in a new
    `args_parser_add_listfile` function that uses `tcc_open`/`tcc_close/inp`
    for buffered file input.
This commit is contained in:
seyko
2016-04-13 07:05:38 +03:00
parent a1a5c81e6c
commit 989b5ee8ae
3 changed files with 94 additions and 27 deletions

1
tcc.c
View File

@ -92,6 +92,7 @@ static void help(void)
" -bench show compilation statistics\n"
" -xc -xa specify type of the next infile\n"
" - use stdin pipe as infile\n"
" @listfile read line separated arguments from 'listfile'\n"
"Preprocessor options:\n"
" -Idir add include path 'dir'\n"
" -Dsym[=val] define 'sym' with value 'val'\n"