可以用MSBuild在ARM下构建C++项目吗? [英] Can MSBuild be used to build a C++ project under ARM?

查看:16
本文介绍了可以用MSBuild在ARM下构建C++项目吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm testing the feasibility of using MSBuild to perform an ARM build of an existing C++ project for Windows Phone and Windows Store. On Windows 7 with VS2012, I opened a Visual Studio 2012 ARM Developer Command Prompt. Then I tried it to see what would happen:

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
)MSBuildMicrosoft.Cppv4.0V110BuildCustomizationsmasm.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)MSBuildMicrosoft.Cppv4.0V110BuildCustomizationsmasm.targets (29,5
)" does not exist in the project, and will be ignored.
Project "C:cryptoppcryptlib.vcxproj" on node 1 (Build target(s)).
C:cryptoppcryptlib.vcxproj : error MSB4057: The target "Build" does not exist 
in the project.
Done Building Project "C:cryptoppcryptlib.vcxproj" (Build target(s)) -- FAILE
D.

Build FAILED.

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

    0 Warning(s)
    1 Error(s)

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

I also tired adding the following to cryptlib.vcxproj, but it resulted in the same error.

<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 上进行测试时,我得到了类似的结果.类似的结果是另一个带有不同错误消息的失败.

Based on the errors above, I'm not sure if MSBuild supports ARM or if something else is wrong. I get similar results when testing on Windows 8 with VS2013. The similar result is another failure with a different error message.

错误信息项目中不存在目标Build"是否意味着MSBuild不支持ARM?ARM下可以用MSBuild构建C++项目吗?

Does the error message The target "Build" does not exist in the project mean MSBuild does not support ARM? Can MSBuild be used to build a C++ project under ARM?

推荐答案

是的,这绝对是可能的.

Yes, this is absolutely possible.

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

The build system for libvpx generates vcxproj/sln files, including support for the ARM platform, and these can be built both with msbuild.exe or opened in Visual Studio.

可以在 https://chromium.googlesource.com/webm/libvpx/+/8b5eddf709b/build/make/gen_msvs_vcxproj.sh.如果您想亲自尝试(查看实际生成的项目文件),请克隆 libvpx,并像这样(在 MSYS shell 中,在libvpx 目录):

The script that generates the project files can be found at https://chromium.googlesource.com/webm/libvpx/+/8b5eddf709b/build/make/gen_msvs_vcxproj.sh. If you want to try it out for yourself (to look at the actual generated project files), clone libvpx, and generate the visual studio project files (targeting Visual Studio 2012) like this (within an MSYS shell, in a directory outside of the libvpx directory):

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

(如果您只是使用 ./configure 在 libvpx 目录中运行它也可能有效,但我只在单独的目录中对其进行了验证.)

(It might also work if you just run this within the libvpx directory with ./configure, but I only verified it in a separate directory.)

如果在路径中找到,make 步骤也会调用 msbuild.exe.如果没有,请打开一个单独的 shell,路径中有 msbuild.exe,然后像这样构建它:

The make step will also invoke msbuild.exe if found in the path. If not, open a separate shell where you've got msbuild.exe in the path, and build it like this:

msbuild vpx.sln -m -t:Build -p:Configuration=Release -p:Platform=ARM

这篇关于可以用MSBuild在ARM下构建C++项目吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆