[Solved] [Moved] Qt Creator , default parameter of make ?
-
Hi,
I wanted to make the default parameter to "make -j4 -w" in the building directory , because for a big project, things went really slow on compiling , especially in windows / mingw32.
Enabling multi-thread of make , can cause problems to stop the process , i tried and it occured.
But still i wanted this to be an option in QtCreator's settings page , is there something already exists ? Or modify mkspec files ? I don't know much about this.
-
How about just setting the MAKEFLAGS environment variable? All decent make implementations use that (at least on Unix;-).
-
Make evaluates MAKEFLAGS itself, so you do not see this reflected in the command line triggered by Qt Creator.
Check your favorite process monitor: It should show several compilers running.
-
Here is a solution that works quite nicely. I export MAKEFLAGS, but you could as well add a -j<n> option directly to the script:
- Create a script similar to the following shell script, it is named qtcreator-make.sh for me (defaults to bash, works for me (tm)):
#!/bin/bash
export PATH=/opt/icecream/bin:/usr/lib/icecc/bin:$PATH
time nice -2 make $*
rc=$?
if [[ $rc != 0 ]] ; then
exit $rc
fi- Either "Override make" in the Qt Creator project setting and select the script, or call Creator from an environment where a link to this script named "make" is found before the platform make tool (usually /usr/bin/make).
Hope this helps!
Mirko.