Skip to content

Commit

Permalink
Fix issue with VS 2019 building and added VS2019 testing (#83)
Browse files Browse the repository at this point in the history
* test compare

* test change

* test

* Fix for win build

* Updated yaml to support building against vs2019

* fix yaml
  • Loading branch information
PolygonalSun authored Jun 21, 2021
1 parent 2daf84b commit ac3e703
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 3 deletions.
142 changes: 140 additions & 2 deletions Build/AzureDevOps/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

jobs:
- job: Windows
- job: Windows_VS2017

pool:
vmImage: 'VS2017-Win2016'
Expand Down Expand Up @@ -62,7 +62,65 @@ jobs:
testResultsFiles: built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test\GLTFSDK.Test.log
condition: and(succeeded(), in(variables['buildPlatform'], 'Win32', 'x64'))

- job: WindowsVcPkg
- job: Windows_VS2019

pool:
vmImage: 'windows-2019'

strategy:
matrix:
Win32-Release:
buildPlatform: Win32
buildConfiguration: Release
Win32-Debug:
buildPlatform: Win32
buildConfiguration: Debug
x64-Release:
buildPlatform: x64
buildConfiguration: Release
x64-Debug:
buildPlatform: x64
buildConfiguration: Debug
ARM-Release:
buildPlatform: ARM
buildConfiguration: Release
ARM-Debug:
buildPlatform: ARM
buildConfiguration: Debug
ARM64-Release:
buildPlatform: ARM64
buildConfiguration: Release
ARM64-Debug:
buildPlatform: ARM64
buildConfiguration: Debug

workspace:
clean: all

steps:

- task: CMake@1
inputs:
workingDirectory: 'built\Int\cmake_$(buildPlatform)'
cmakeArgs: '..\..\.. -G "Visual Studio 16 2019" -A "$(buildPlatform)"'

- task: CMake@1
inputs:
workingDirectory: 'built\Int\cmake_$(buildPlatform)'
cmakeArgs: '--build . --target install --config $(buildConfiguration) -- /m'

- script: .\GLTFSDK.Test.exe --gtest_output=xml:GLTFSDK.Test.log
workingDirectory: built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test
displayName: Running Unit Tests
condition: and(succeeded(), in(variables['buildPlatform'], 'Win32', 'x64'))

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test\GLTFSDK.Test.log
condition: and(succeeded(), in(variables['buildPlatform'], 'Win32', 'x64'))

- job: WindowsVcPkg_VS2017

pool:
vmImage: 'VS2017-Win2016'
Expand Down Expand Up @@ -142,6 +200,86 @@ jobs:
testResultsFiles: built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test\GLTFSDK.Test.log
condition: and(succeeded(), in(variables['buildPlatform'], 'Win32', 'x64'))

- job: WindowsVcPkg_VS2019

pool:
vmImage: 'windows-2019'

strategy:
matrix:
Win32-Release:
buildPlatform: Win32
buildConfiguration: Release
vcpkgTriplet: x86-windows
Win32-Debug:
buildPlatform: Win32
buildConfiguration: Debug
vcpkgTriplet: x86-windows
x64-Release:
buildPlatform: x64
buildConfiguration: Release
vcpkgTriplet: x64-windows
x64-Debug:
buildPlatform: x64
buildConfiguration: Debug
vcpkgTriplet: x64-windows
ARM-Release:
buildPlatform: ARM
buildConfiguration: Release
vcpkgTriplet: arm-windows
ARM-Debug:
buildPlatform: ARM
buildConfiguration: Debug
vcpkgTriplet: arm-windows
ARM64-Release:
buildPlatform: ARM64
buildConfiguration: Release
vcpkgTriplet: arm64-windows
ARM64-Debug:
buildPlatform: ARM64
buildConfiguration: Debug
vcpkgTriplet: arm64-windows

workspace:
clean: all

variables:
vcpkgRoot: "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"

steps:
- powershell: vcpkg install --triplet "$(vcpkgTriplet)" rapidjson gtest
displayName: Install packages with VcPkg

- task: CMake@1
inputs:
workingDirectory: 'built\Int\cmake_$(buildPlatform)'
cmakeArgs: '..\..\.. -G "Visual Studio 16 2019" -A "$(buildPlatform)" -DCMAKE_TOOLCHAIN_FILE="$(vcpkgRoot)" -DVCPKG_TARGET_TRIPLET="$(vcpkgTriplet)"'

- task: CMake@1
inputs:
workingDirectory: 'built\Int\cmake_$(buildPlatform)'
cmakeArgs: '--build . --target install --config $(buildConfiguration) -- /m'

# copy googletest related dll files
- task: CopyFiles@2
inputs:
sourceFolder: 'built\Int\cmake_$(buildPlatform)\GLTFSDK.Test\$(buildConfiguration)'
contents: 'gtest*.dll'
targetFolder: 'built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test'
overWrite: true
condition: in(variables['buildPlatform'], 'Win32', 'x64')

- script: .\GLTFSDK.Test.exe --gtest_output=xml:GLTFSDK.Test.log
workingDirectory: built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test
displayName: Running Unit Tests
condition: and(succeeded(), in(variables['buildPlatform'], 'Win32', 'x64'))

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: built\Out\windows_$(buildPlatform)\$(buildConfiguration)\GLTFSDK.Test\GLTFSDK.Test.log
condition: and(succeeded(), in(variables['buildPlatform'], 'Win32', 'x64'))

- job: MacOS

pool:
Expand Down
2 changes: 1 addition & 1 deletion GLTFSDK/Inc/GLTFSDK/GLTFResourceReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ namespace Microsoft
for (size_t i = 0; i < indices.size(); i++)
{
// Verify provided index is valid before storing value
if ((indices[i] * typeCount + (typeCount - 1)) < baseData.size())
if ((indices[i] * typeCount + (typeCount - 1)) < static_cast<int>(baseData.size()))
{
for (size_t j = 0; j < typeCount; j++)
{
Expand Down

0 comments on commit ac3e703

Please sign in to comment.