On Linux, is there a way to pass arguments to gcc from a file. That is to gave file like compile.args
% cat compile.args
-g3
-ggdb
-pedantic
-pedantic-errors
-Wall
-Werror
-O0
vec1.cpp
-o vec1
and then give this file to g++/gcc. I can do this using cat compile.args | xargs g++, is they any other way? Does gcc support this?
thanks.
Yes, just run gcc @compile.args
For verbosity, also something like this should work (depending on running shell)
g++ `cat compiler.args|xargs`
or
COMPILE_ARGS=`cat compiler.args|xargs` g++ ${COMPILE_ARGS}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With