How do I get Windows to go as fast as Linux for compiling C++?

后端 未结 13 1033
生来不讨喜
生来不讨喜 2020-12-22 15:14

I know this is not so much a programming question but it is relevant.

I work on a fairly large cross platform project. On Windows I use VC++ 2008. On Linux I use gcc

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-22 15:38

    How do you build your large cross platform project? If you are using common makefiles for Linux and Windows you could easily degrade windows performance by a factor of 10 if the makefiles are not designed to be fast on Windows.

    I just fixed some makefiles of a cross platform project using common (GNU) makefiles for Linux and Windows. Make is starting a sh.exe process for each line of a recipe causing the performance difference between Windows and Linux!

    According to the GNU make documentation

    .ONESHELL:

    should solve the issue, but this feature is (currently) not supported for Windows make. So rewriting the recipes to be on single logical lines (e.g. by adding ;\ or \ at the end of the current editor lines) worked very well!

提交回复
热议问题