MSVC 编译器支持 command files用于传递命令行选项。这主要是由于可以传递给 CreateProcess 的命令行参数的大小受到限制。打电话。
这在 Linux 系统上不是什么大问题,但在执行 Unix 应用程序的 cygwin 端口时,例如 gcc,同样的限制适用。
因此,有谁知道 gcc/g++ 是否也支持某种类型的命令文件?
最佳答案
当然可以!
@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
临时装配这种类型的东西。
关于linux - GCC是否支持命令文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7139685/