共用方式為


HOW TO:使用 DEVENV 命令列參數執行多處理器組建

更新:2007 年 11 月

使用 Devenv 命令列參數執行多處理器組建和從 IDE 執行多處理器組建的作用相似。可以同時建置的專案數目需視 [平行專案建置的最大數目] 屬性 (Property) 值而定。

注意事項:

若要使用 DEVENV 啟用多處理器組建,[平行專案建置的最大數目] 屬性必須設為大於 1 的值。如需如何變更此屬性的詳細資訊,請參閱 HOW TO:設定多處理器組建的並行建置數目

使用 DEVENV 命令列參數啟用多處理器組建時,如果使用下列建置選項叫用 (Invoke) DEVENV,多處理器組建便會自動執行:

若要使用 DEVENV 命令列參數執行多處理器組建

  1. 開啟命令視窗

    注意事項:

    若要設定適當的環境變數以便在命令工作階段中執行 Visual Studio 工具,您可能需要執行 VSVARS32.BAT 或 VCVARS32.BAT

  2. 在命令提示字元下,輸入下列命令列以建置方案:

    devenv <solution>.sln [options] solutionconfig [/project projectnameorfile [/projectconfig name]]
    

    <solution> 指定方案檔的檔名 (若有需要會指定路徑)。

範例

下列範例會說明如何使用 DEVENV 命令列參數執行多處理器組建。若要設定本範例,請建立名稱為 MultiprocExample 的新方案,這是由兩個 C++ 主控台應用程式 (Console Application) 所組成,其中一個名為 Console1,而另一個則為 Console2。

使用下列命令列執行皆位於偵錯組態中的 Console1 和 Console2 多處理器重建。

D:\>devenv "D:\Documents and Settings\username\My Documents\Visual Studio\Projects\MultiprocExample\MultiprocExample.sln" /rebuild Debug

1>------ Rebuild All started: Project: Console2, Configuration: Debug Win32 ----
--
2>------ Rebuild All started: Project: Console1, Configuration: Debug Win32 ----
--
1>Deleting intermediate and output files for project 'Console2', configuration '
Debug|Win32'
2>Deleting intermediate and output files for project 'Console1', configuration '
Debug|Win32'
1>Compiling...
2>Compiling...
1>stdafx.cpp
2>stdafx.cpp
1>Compiling...
2>Compiling...
1>Console2.cpp
2>Console1.cpp
1>AssemblyInfo.cpp
2>AssemblyInfo.cpp
1>Generating Code...
2>Generating Code...
1>Compiling resources...
2>Compiling resources...
2>Linking...
1>Linking...
1>Build log was saved at "file://d:\Documents and Settings\username\My Documents
\Visual Studio\Projects\MultiprocExample\Console2\Debug\BuildLog.htm"
1>Console2 - 0 error(s), 0 warning(s)
1>
2>Build log was saved at "file://d:\Documents and Settings\username\My Documents
\Visual Studio\Projects\MultiprocExample\Console1\Debug\BuildLog.htm"
2>Console1 - 0 error(s), 0 warning(s)
2>
---------------------- Done ----------------------

    Rebuild All: 2 succeeded, 0 failed, 0 skipped

請參閱

工作

HOW TO:在 IDE 中執行多處理器組建

HOW TO:以 VCBUILD 執行多處理器組建