Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc -save-temps: how to specify directory

Tags:

gcc

Is it possible to specify the output directory of the -save-temps artifacts?

I know I can do a mv afterwards but wondering if there's a way to avoid the extra step.

like image 379
Bob Avatar asked Jan 29 '23 14:01

Bob


1 Answers

You can specify that the -save-temps artifacts will be saved in current directory of the compilation with either of:-

-save-temps
-save-temps=cwd

Or you can specify that they will be saved in the same directory as the corresponding .o files, provided that the -o option is also used, with:

-save-temps=obj

Those are your only options. Here is the documentation

like image 193
Mike Kinghan Avatar answered Feb 05 '23 17:02

Mike Kinghan