How can I run the MSVC preprocessor and compiler in two separate steps?

后端 未结 2 909
孤独总比滥情好
孤独总比滥情好 2021-01-12 00:14

I\'d like to run the Microsoft Visual Studio Compiler cl.exe without invoking the preprocessor. Is this possible? I thought that simply compiling preprocessed s

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 00:25

    It may well be that a lot of the time you think the preprocessor is taking is actually time spent writing that large file to disk. The preprocessor should actually take a tiny percentage of the time that the rest of the compiler takes. A big benefit of a normal pre/compilation is that the the compiler can begin compiling while the preprocessor stage is still running, perhaps in a separate thread or as it detects new preprocessor output. The large preprocessor output may not need to ever occupy memory (let alone disk), as it's consumed and overwritten in smaller chunks.

提交回复
热议问题