GCC是否支持命令文件

时间:2011-08-21 16:55:33

标签: linux gcc g++ cygwin

MSVC编译器支持用于传递命令行选项的command files。这主要是由于可以传递给CreateProcess调用的命令行参数大小的限制。

这在Linux系统上不是问题,但在执行Unix应用程序的cygwin端口时,例如gcc,同样的限制也适用。

因此,有没有人知道gcc / g ++是否也支持某种类型的命令文件?

感谢。

1 个答案:

答案 0 :(得分:12)

当然!

@file
           Read command-line options from file.  The options read are inserted
           in place of the original @file option.  If file does not exist, or
           cannot be read, then the option will be treated literally, and not
           removed.

           Options in file are separated by whitespace.  A whitespace
           character may be included in an option by surrounding the entire
           option in either single or double quotes.  Any character (including
           a backslash) may be included by prefixing the character to be
           included with a backslash.  The file may itself contain additional
           @file options; any such options will be processed recursively.

如果您的平台拥有xargs,您还可以使用{{1}}对此类事件进行评审。