0

我正在编写一个 MSBuild 脚本,它使用 MSBuild CL 任务编译 C++ 文件,例如:

<CL Sources="c:\temp\myfile.cpp" />

我如何控制输出(myfile.obj)的去向?默认情况下,它转到脚本所在的路径(也恰好是我运行脚本的路径):即如果我从“ c : \someFolder\"然后 myfile.obj 被放置在"c:\someFolder\myfile.obj"

通过一个疯狂的(不合逻辑的)猜测,我也尝试过使用 OutDir 属性(?!),比如:

<PropertyGroup>
  <OutDir>d:\somePlace\<OutDir>
</PropertyGroup>
...
<CL Sources="c:\temp\myfile.cpp" />

没用。

4

1 回答 1

0

The answer to the original question about how to control the output of the CL task is by using the ObjectFileName argument (as provided by Hans Passant).

However, it now seems that using a minimum standard vcxproj is a better idea (as suggested by both stijn and Hans Passant).

于 2013-10-08T12:35:17.900 回答