问题
The PC I'm using has 4 cores so I wanna use all them while compiling, which I do by passing the -j4
option to the compiler. In Qt Creator I do that by adding an environment variable in the Build Environment
panel, as shown in the images:
MAKEFLAGS = -j4
The problem is that this setting doesn't persist across all projects in the PC I'm using, which will be cool. So I have to do that for each project at least once. I think this is stored in the .pro.user
file, since every time .pro.user
gets deleted the MAKEFLAGS = -j4
desapears from the Build Environment
panel.
Isn't possible to just add this setting via .pro
project file?
I'm interested in any approach which will allow me to escape from the necessity of setting that stuff multiple times.
To give a little context, I'm on Windows.
回答1:
You're looking for shared project settings in a .pro.shared
file. They are designed exactly for what you have in mind.
Adding the setting to a .pro
file is wrong, since that file is meant to be portable and not tied to any particular build host.
来源:https://stackoverflow.com/questions/38457212/makeflags-in-qt-creator-via-pro-project-file