MAKEFLAGS in Qt Creator via .pro project file

无人久伴 提交于 2019-12-12 13:27:42

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!