可以使用MSBuild在ARM下构建C ++项目吗?

时间:2016-10-06 17:20:27

标签: visual-studio msbuild arm

我正在测试使用MSBuild为Windows Phone和Windows Store执行现有C ++项目的ARM构建的可行性。在带有VS2012的Windows 7上,我打开了Visual Studio 2012 ARM Developer命令提示符。然后我试着看看会发生什么:

C:\cryptopp>msbuild /t:Build /p:Configuration=Debug;Platform=ARM cryptlib.vcxproj
Microsoft (R) Build Engine version 4.6.1055.0

Build started 10/6/2016 1:11:47 PM.
The target "Midl" listed in a BeforeTargets attribute at "C:\Program Files (x86
)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\masm.targets (28,5)" does
 not exist in the project, and will be ignored.
The target "CustomBuild" listed in an AfterTargets attribute at "C:\Program Fil
es (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\masm.targets (29,5
)" does not exist in the project, and will be ignored.
Project "C:\cryptopp\cryptlib.vcxproj" on node 1 (Build target(s)).
C:\cryptopp\cryptlib.vcxproj : error MSB4057: The target "Build" does not exist 
in the project.
Done Building Project "C:\cryptopp\cryptlib.vcxproj" (Build target(s)) -- FAILE
D.

Build FAILED.

"C:\cryptopp\cryptlib.vcxproj" (Build target) (1)
->
  C:\cryptopp\cryptlib.vcxproj : error MSB4057: The target "Build" does not exi
st in the project.

    0 Warning(s)
    1 Error(s)

我也厌倦了将以下内容添加到cryptlib.vcxproj,但导致了同样的错误。

<ProjectConfiguration Include="Debug|ARM">
  <Configuration>Debug</Configuration>
  <Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
  <Configuration>Release</Configuration>
  <Platform>ARM</Platform>
</ProjectConfiguration>

根据上面的错误,我不确定MSBuild是否支持ARM或者是否有其他错误。在使用VS2013的Windows 8上进行测试时,我得到了类似的结果。类似的结果是另一个失败的错误消息。

错误消息 The target "Build" does not exist in the project 是否意味着MSBuild不支持ARM?可以使用MSBuild在ARM下构建C ++项目吗?

1 个答案:

答案 0 :(得分:1)

是的,这绝对是可能的。

libvpx的构建系统会生成vcxproj / sln个文件,包括对ARM平台的支持,这些文件可以使用msbuild.exe或在Visual Studio中打开。

可以在https://chromium.googlesource.com/webm/libvpx/+/8b5eddf709b/build/make/gen_msvs_vcxproj.sh找到生成项目文件的脚本。如果你想亲自尝试一下(查看实际生成的项目文件),克隆libvpx,并像这样生成visual studio项目文件(针对Visual Studio 2012)(在MSYS shell中,在一个目录之外的目录中) libvpx目录):

../libvpx/configure --target=armv7-win32-vs11
make

(如果您只是在带有./configure的libvpx目录中运行它,它也可以工作,但我只在一个单独的目录中验证它。)

如果在路径中找到,则make步骤也会调用msbuild.exe。如果没有,请打开一个单独的shell,在路径中有msbuild.exe,并按照以下方式构建它:

msbuild vpx.sln -m -t:Build -p:Configuration=Release -p:Platform=ARM
相关问题