How to compile on multiple cores using mingw inside QTCreator

后端 未结 7 1239
被撕碎了的回忆
被撕碎了的回忆 2020-12-29 22:54

I have a quad-core i7 CPU on my windows desktop. I am trying to get mingw32-make to compile using as many core as possible. I have added -j8 into the \"Make Arguments\" fiel

7条回答
  •  不知归路
    2020-12-29 23:17

    Add -j9 (replace 9 to value of NUMBER_OF_PROCESSORS(Windows)/$(nproc)(Linux) plus one — this is optimal) to all

    QString makefilein = " -f " + subtarget->makefile;
    

    lines in qmake\generators\makefile.cpp (find it yourself).

    It results as

    QString makefilein = " -j9 -f " + subtarget->makefile;
    

    then run configure.exe with proper parametres (!and additional -qmake -dont-process to avoid generation abundance of makefiles!).

    The problem is that you get two sets of processes during "debug and release" build. Thereby, total count of processes spawned is 18+.

提交回复
热议问题