Skip to content

Commit

Permalink
Attempt templates and other tricks I learned from microsoft/STL#114
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyONeal committed Sep 27, 2019
1 parent 42f48fd commit 8f0a93e
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 211 deletions.
52 changes: 52 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"configurations": [
{
"name": "x86_Debug",
"buildCommandArgs": "-v",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"cmakeCommandArgs": "",
"configurationType": "Debug",
"ctestCommandArgs": "",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x86" ],
"installRoot": "${projectDir}\\out\\install\\${name}",
"variables": []
},
{
"name": "x86_Release",
"buildCommandArgs": "-v",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"cmakeCommandArgs": "",
"configurationType": "Release",
"ctestCommandArgs": "",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x86" ],
"installRoot": "${projectDir}\\out\\install\\${name}",
"variables": []
},
{
"name": "x64_Debug",
"buildCommandArgs": "-v",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"cmakeCommandArgs": "",
"configurationType": "Debug",
"ctestCommandArgs": "",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
"installRoot": "${projectDir}\\out\\install\\${name}",
"variables": []
},
{
"name": "x64_Releaes",
"buildCommandArgs": "-v",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"cmakeCommandArgs": "",
"configurationType": "Release",
"ctestCommandArgs": "",
"generator": "Ninja",
"inheritEnvironments": [ "msvc_x64_x64" ],
"installRoot": "${projectDir}\\out\\install\\${name}",
"variables": []
}
]
}
40 changes: 40 additions & 0 deletions azure-devops/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
parameters:
name: 'Windows_VS2019_x86'
targetPlatform: 'x86'
image: 'windows-latest'

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.image }}
variables:
vcpkgLocation: '$(Build.SourcesDirectory)/vcpkg'
vcpkgResponseFile: $(Build.SourcesDirectory)/azure-devops/vcpkg-windows.txt
steps:
- task: CacheBeta@0
displayName: Cache vcpkg
inputs:
key: $(vcpkgResponseFile) | $(Build.SourcesDirectory)/.git/modules/vcpkg/HEAD | ${{ parameters.targetPlatform }} | ${{ parameters.image }}
path: '$(vcpkgLocation)'
- task: run-vcpkg@0
displayName: 'Run vcpkg'
inputs:
vcpkgArguments: '@$(vcpkgResponseFile)'
vcpkgDirectory: '$(vcpkgLocation)'
vcpkgTriplet: ${{ parameters.targetPlatform }}-windows
- task: run-cmake@0
displayName: 'Run CMake with Ninja'
enabled: true
inputs:
cmakeListsTxtPath: 'CMakeSettings.json'
useVcpkgToolchainFile: true
configurationRegexFilter: '.*${{ parameters.targetPlatform }}.*'
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}
- script: |
cd out\build\${{ parameters.targetPlatform }}_Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- script: |
cd out\build\${{ parameters.targetPlatform }}_Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
7 changes: 7 additions & 0 deletions azure-devops/vcpkg-windows.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
openssl
boost-system
boost-date-time
boost-regex
boost-interprocess
websocketpp
brotli
241 changes: 30 additions & 211 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,36 @@
# CppRestSdk Azure Pipelines Configuration

jobs:
- job: Windows_VS2019_x86
pool:
vmImage: 'windows-latest'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
- script: |
cd build.common\Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
configuration: 'Release'
- script: |
cd build.common\Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
- job: Windows_VS2019_x64
pool:
vmImage: 'windows-latest'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
- script: |
cd build.common\Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
configuration: 'Release'
- script: |
cd build.common\Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
- template: azure-devops/build-windows.yml
parameters:
name: 'Windows_VS2019_x86'
targetPlatform: x86
image: 'windows-latest'
- template: azure-devops/build-windows.yml
parameters:
name: 'Windows_VS2019_x64'
targetPlatform: x64
image: 'windows-latest'
- template: azure-devops/build-windows.yml
parameters:
name: 'Windows_VS2017_x86'
targetPlatform: x86
image: 'vs2017-win2016'
- template: azure-devops/build-windows.yml
parameters:
name: 'Windows_VS2017_x64'
targetPlatform: x64
image: 'vs2017-win2016'
- template: azure-devops/build-windows.yml
parameters:
name: 'Windows_VS2015_x86'
targetPlatform: x86
image: 'vs2015-win2012r2'
- template: azure-devops/build-windows.yml
parameters:
name: 'Windows_VS2015_x64'
targetPlatform: x64
image: 'vs2015-win2012r2'
- job: Windows_VS2019_UWP
pool:
vmImage: 'windows-latest'
Expand All @@ -84,153 +50,6 @@ jobs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
- job: Windows_VS2017_x86
pool:
vmImage: 'vs2017-win2016'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
- script: |
cd build.common\Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
configuration: 'Release'
- script: |
cd build.common\Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
- job: Windows_VS2017_x64
pool:
vmImage: 'vs2017-win2016'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
- script: |
cd build.common\Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
configuration: 'Release'
- script: |
cd build.common\Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
- job: Windows_VS2017_UWP
pool:
vmImage: 'vs2017-win2016'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib --triplet x64-uwp --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
- job: Windows_VS2015_x86
pool:
vmImage: 'vs2015-win2012r2'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
- script: |
cd build.common\Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
configuration: 'Release'
- script: |
cd build.common\Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
- job: Windows_VS2015_x64
pool:
vmImage: 'vs2015-win2012r2'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --vcpkg-root .\vcpkg
displayName: vcpkg install dependencies
- script: mkdir build.common
displayName: Make Build Directory
- task: CMake@1
inputs:
workingDirectory: 'build.common'
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
- script: |
cd build.common\Release\Binaries\Debug
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: MSBuild@1
inputs:
solution: 'build.common/ALL_BUILD.vcxproj'
maximumCpuCount: true
platform: 'x64'
configuration: 'Release'
- script: |
cd build.common\Release\Binaries\Release
.\test_runner.exe *test.dll
displayName: 'Run tests, release'
- job: Ubuntu_1604_Apt
pool:
vmImage: 'Ubuntu 16.04'
Expand Down

0 comments on commit 8f0a93e

Please sign in to comment.