How can I do a parallel build in Visual Studio 2010?

前端 未结 6 1801
太阳男子
太阳男子 2020-12-23 12:18

How can I get VS 2010 to run more than one C++ compile process at a time? I mean building object modules in parallel; I\'m not interested in building more than one project a

6条回答
  •  一生所求
    2020-12-23 12:54

    Necrolis' comment seems the correct solution.

    /MP (Build with Multiple Processes)

    The /MP option causes the compiler to create one or more copies of itself, each in a separate process. These copies simultaneously compile the source files. Consequently, the total time to build the source files can be significantly reduced.

    Note that you can set it at project level (and thus it will apply to all files in it) as well as to the individual files, useful for instance if you need to use #import.

    In particular, /MP is usually not compatible with precompiled headers, or sources using #import; in this case, you can still set /MP flag on the project, and then clear it on the single files (usually, stdafx.cpp, and any file using #import).

提交回复
热议问题