为什么AppVeyor将VS2010工具用于VS2015映像?

时间:2017-08-03 04:29:52

标签: visual-studio msbuild appveyor

我们是一个C ++库。我们正在努力使用x64版本的AppVeyor和Visual Studio构建图像。用于Win32的Visual Studio构建映像遇到了同样的问题,但由于某些[未知]原因,它们成功完成。

我们正在尝试使用Visual Studio 2015构建映像(以及其他):

enter image description here

当我们检查命令行时,看来我们正在使用Visual Studio 2010编译器(Visual Studio 10.0 is VS2010):

enter image description here

我们的AppVeyor配置文件位于Noloader GitHub | .appveyor.yml。它也显示如下。

一切都是通过.appveyor.yml驱动的。没有隐藏的设置影响事物(或者我们不相信)。我们想要.appveyor.yml中的所有内容,以便人们可以克隆它和事物"只是工作"对他们来说。

项目文件位于GitHub cryptest.vcxprojcryptlib.vcxproj。 * .vcxproj文件使用硬编码$(DefaultPlatformToolset)作为suggested by @stinj。 ( 编辑 DefaultPlatformToolset - 不再了。我们已完全删除DefaultPlatformToolsetPlatformToolset。)

项目的构建结果位于Noloader AppVeyor | cryptopp。它是屏幕截图的来源。

为什么使用了错误的构建工具,我们如何解决它?

当我避开$(DefaultPlatformToolset)并硬编码平台工具集的值时,它会导致另一个错误。例如,下面是Visual Studio 2015构建映像。当工具集版本设置为v140时,它会死亡,这是VS2015版本值。真令人迷惑。

Commit ac513c06f8c8最终还原,因为它比以前更糟糕了。)

enter image description here

当我们在VCXPROJ文件中完全删除PlatformToolsetDefaultPlatformToolset的所有痕迹时,会导致相同的错误。以下是Visual Studio 2017构建映像。

enter image description here

version: 1.0.{build}
clone_depth: 3

configuration:

- Debug
- Release

platform:

- Win32
- x64

image:

- Visual Studio 2017
- Visual Studio 2015
- Visual Studio 2013

build: off   

test_script:

- cmd: >-   

    msbuild /t:Build /p:platform=%platform%;configuration=%configuration% cryptlib.vcxproj

    msbuild /t:Build /p:platform=%platform%;configuration=%configuration% cryptest.vcxproj

    msbuild /t:CopyCryptestToRoot cryptest.vcxproj

    cryptest.exe v

    cryptest.exe tv all

matrix:

  exclude:
#    - platform: x64
#      configuration: Debug
#    - platform: x64
#      configuration: Release
    - image: Visual Studio 2010
    - image: Visual Studio 2017

notifications:
    - provider: Email
      to:
        - cryptopp-build@googlegroups.com
      on_build_success: true
      on_build_failure: true

1 个答案:

答案 0 :(得分:2)

以下是我的工作方式:

  • ToolsVersion="$(ToolsVersion)"个文件中设置<PlatformToolset>$(TOOLSET)</PlatformToolset>.vcxproj

  • 添加值TOOLSET的环境变量v140和值ToolsVersion的{​​{1}}

要使用不同变量实现所需的所有组合,您可以使用build matrix并避免exclude configuration from the matrix不需要的组合。

更新:矩阵样本

14.0
相关问题