Skip to content

Commit ada27eb

Browse files
committed
Attempt templates and other tricks I learned from microsoft/STL#114
1 parent 42f48fd commit ada27eb

File tree

4 files changed

+129
-211
lines changed

4 files changed

+129
-211
lines changed

CMakeSettings.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "x86_Debug",
5+
"buildCommandArgs": "-v",
6+
"buildRoot": "${projectDir}\\out\\build\\${name}",
7+
"cmakeCommandArgs": "",
8+
"configurationType": "Debug",
9+
"ctestCommandArgs": "",
10+
"generator": "Ninja",
11+
"inheritEnvironments": [ "msvc_x86" ],
12+
"installRoot": "${projectDir}\\out\\install\\${name}",
13+
"variables": []
14+
},
15+
{
16+
"name": "x86_Release",
17+
"buildCommandArgs": "-v",
18+
"buildRoot": "${projectDir}\\out\\build\\${name}",
19+
"cmakeCommandArgs": "",
20+
"configurationType": "Release",
21+
"ctestCommandArgs": "",
22+
"generator": "Ninja",
23+
"inheritEnvironments": [ "msvc_x86" ],
24+
"installRoot": "${projectDir}\\out\\install\\${name}",
25+
"variables": []
26+
},
27+
{
28+
"name": "x64_Debug",
29+
"buildCommandArgs": "-v",
30+
"buildRoot": "${projectDir}\\out\\build\\${name}",
31+
"cmakeCommandArgs": "",
32+
"configurationType": "Debug",
33+
"ctestCommandArgs": "",
34+
"generator": "Ninja",
35+
"inheritEnvironments": [ "msvc_x64_x64" ],
36+
"installRoot": "${projectDir}\\out\\install\\${name}",
37+
"variables": []
38+
},
39+
{
40+
"name": "x64_Releaes",
41+
"buildCommandArgs": "-v",
42+
"buildRoot": "${projectDir}\\out\\build\\${name}",
43+
"cmakeCommandArgs": "",
44+
"configurationType": "Release",
45+
"ctestCommandArgs": "",
46+
"generator": "Ninja",
47+
"inheritEnvironments": [ "msvc_x64_x64" ],
48+
"installRoot": "${projectDir}\\out\\install\\${name}",
49+
"variables": []
50+
}
51+
]
52+
}

azure-devops/build-windows.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
parameters:
2+
name: 'Windows_VS2019_x86'
3+
targetPlatform: 'x86'
4+
image: 'windows-latest'
5+
6+
jobs:
7+
- job: ${{ parameters.name }}
8+
pool:
9+
vmImage: ${{ parameters.image }}
10+
variables:
11+
vcpkgLocation: '$(Build.SourcesDirectory)/vcpkg'
12+
vcpkgResponseFile: $(Build.SourcesDirectory)/azure-devops/vcpkg-windows.txt
13+
steps:
14+
- task: CacheBeta@0
15+
displayName: Cache vcpkg
16+
inputs:
17+
key: $(vcpkgResponseFile) | $(Build.SourcesDirectory)/.git/modules/vcpkg/HEAD | ${{ parameters.targetPlatform }} | ${{image}}
18+
path: '$(vcpkgLocation)'
19+
- task: run-vcpkg@0
20+
displayName: 'Run vcpkg'
21+
inputs:
22+
vcpkgArguments: '@$(vcpkgResponseFile)'
23+
vcpkgDirectory: '$(vcpkgLocation)'
24+
vcpkgTriplet: ${{ parameters.targetPlatform }}-windows
25+
- task: run-cmake@0
26+
displayName: 'Run CMake with Ninja'
27+
enabled: true
28+
inputs:
29+
cmakeListsTxtPath: 'CMakeSettings.json'
30+
useVcpkgToolchainFile: true
31+
configurationRegexFilter: '.*${{ parameters.targetPlatform }}.*'
32+
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}
33+
- script: |
34+
cd out\build\${{ parameters.targetPlatform }}_Release\Binaries\Debug
35+
.\test_runner.exe *testd.dll
36+
displayName: 'Run tests, debug'
37+
- script: |
38+
cd out\build\${{ parameters.targetPlatform }}_Release\Binaries\Release
39+
.\test_runner.exe *test.dll
40+
displayName: 'Run tests, release'

azure-devops/vcpkg-windows.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
openssl
2+
boost-system
3+
boost-date-time
4+
boost-regex
5+
boost-interprocess
6+
websocketpp
7+
brotli

azure-pipelines.yml

Lines changed: 30 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,36 @@
11
# CppRestSdk Azure Pipelines Configuration
22

33
jobs:
4-
- job: Windows_VS2019_x86
5-
pool:
6-
vmImage: 'windows-latest'
7-
steps:
8-
- script: .\vcpkg\bootstrap-vcpkg.bat
9-
displayName: Bootstrap vcpkg
10-
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --vcpkg-root .\vcpkg
11-
displayName: vcpkg install dependencies
12-
- script: mkdir build.common
13-
displayName: Make Build Directory
14-
- task: CMake@1
15-
inputs:
16-
workingDirectory: 'build.common'
17-
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
18-
- task: MSBuild@1
19-
inputs:
20-
solution: 'build.common/ALL_BUILD.vcxproj'
21-
maximumCpuCount: true
22-
- script: |
23-
cd build.common\Release\Binaries\Debug
24-
.\test_runner.exe *testd.dll
25-
displayName: 'Run tests, debug'
26-
- task: MSBuild@1
27-
inputs:
28-
solution: 'build.common/ALL_BUILD.vcxproj'
29-
maximumCpuCount: true
30-
configuration: 'Release'
31-
- script: |
32-
cd build.common\Release\Binaries\Release
33-
.\test_runner.exe *test.dll
34-
displayName: 'Run tests, release'
35-
- job: Windows_VS2019_x64
36-
pool:
37-
vmImage: 'windows-latest'
38-
steps:
39-
- script: .\vcpkg\bootstrap-vcpkg.bat
40-
displayName: Bootstrap vcpkg
41-
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --vcpkg-root .\vcpkg
42-
displayName: vcpkg install dependencies
43-
- script: mkdir build.common
44-
displayName: Make Build Directory
45-
- task: CMake@1
46-
inputs:
47-
workingDirectory: 'build.common'
48-
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
49-
- task: MSBuild@1
50-
inputs:
51-
solution: 'build.common/ALL_BUILD.vcxproj'
52-
maximumCpuCount: true
53-
platform: 'x64'
54-
- script: |
55-
cd build.common\Release\Binaries\Debug
56-
.\test_runner.exe *testd.dll
57-
displayName: 'Run tests, debug'
58-
- task: MSBuild@1
59-
inputs:
60-
solution: 'build.common/ALL_BUILD.vcxproj'
61-
maximumCpuCount: true
62-
platform: 'x64'
63-
configuration: 'Release'
64-
- script: |
65-
cd build.common\Release\Binaries\Release
66-
.\test_runner.exe *test.dll
67-
displayName: 'Run tests, release'
4+
- template: azure-devops/build-windows.yml
5+
parameters:
6+
name: 'Windows_VS2019_x86'
7+
targetPlatform: x86
8+
image: 'windows-latest'
9+
- template: azure-devops/build-windows.yml
10+
parameters:
11+
name: 'Windows_VS2019_x64'
12+
targetPlatform: x64
13+
image: 'windows-latest'
14+
- template: azure-devops/build-windows.yml
15+
parameters:
16+
name: 'Windows_VS2017_x86'
17+
targetPlatform: x86
18+
image: 'vs2017-win2016'
19+
- template: azure-devops/build-windows.yml
20+
parameters:
21+
name: 'Windows_VS2017_x64'
22+
targetPlatform: x64
23+
image: 'vs2017-win2016'
24+
- template: azure-devops/build-windows.yml
25+
parameters:
26+
name: 'Windows_VS2015_x86'
27+
targetPlatform: x86
28+
image: 'vs2015-win2012r2'
29+
- template: azure-devops/build-windows.yml
30+
parameters:
31+
name: 'Windows_VS2015_x64'
32+
targetPlatform: x64
33+
image: 'vs2015-win2012r2'
6834
- job: Windows_VS2019_UWP
6935
pool:
7036
vmImage: 'windows-latest'
@@ -84,153 +50,6 @@ jobs:
8450
solution: 'build.common/ALL_BUILD.vcxproj'
8551
maximumCpuCount: true
8652
platform: 'x64'
87-
- job: Windows_VS2017_x86
88-
pool:
89-
vmImage: 'vs2017-win2016'
90-
steps:
91-
- script: .\vcpkg\bootstrap-vcpkg.bat
92-
displayName: Bootstrap vcpkg
93-
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --vcpkg-root .\vcpkg
94-
displayName: vcpkg install dependencies
95-
- script: mkdir build.common
96-
displayName: Make Build Directory
97-
- task: CMake@1
98-
inputs:
99-
workingDirectory: 'build.common'
100-
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
101-
- task: MSBuild@1
102-
inputs:
103-
solution: 'build.common/ALL_BUILD.vcxproj'
104-
maximumCpuCount: true
105-
- script: |
106-
cd build.common\Release\Binaries\Debug
107-
.\test_runner.exe *testd.dll
108-
displayName: 'Run tests, debug'
109-
- task: MSBuild@1
110-
inputs:
111-
solution: 'build.common/ALL_BUILD.vcxproj'
112-
maximumCpuCount: true
113-
configuration: 'Release'
114-
- script: |
115-
cd build.common\Release\Binaries\Release
116-
.\test_runner.exe *test.dll
117-
displayName: 'Run tests, release'
118-
- job: Windows_VS2017_x64
119-
pool:
120-
vmImage: 'vs2017-win2016'
121-
steps:
122-
- script: .\vcpkg\bootstrap-vcpkg.bat
123-
displayName: Bootstrap vcpkg
124-
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --vcpkg-root .\vcpkg
125-
displayName: vcpkg install dependencies
126-
- script: mkdir build.common
127-
displayName: Make Build Directory
128-
- task: CMake@1
129-
inputs:
130-
workingDirectory: 'build.common'
131-
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
132-
- task: MSBuild@1
133-
inputs:
134-
solution: 'build.common/ALL_BUILD.vcxproj'
135-
maximumCpuCount: true
136-
platform: 'x64'
137-
- script: |
138-
cd build.common\Release\Binaries\Debug
139-
.\test_runner.exe *testd.dll
140-
displayName: 'Run tests, debug'
141-
- task: MSBuild@1
142-
inputs:
143-
solution: 'build.common/ALL_BUILD.vcxproj'
144-
maximumCpuCount: true
145-
platform: 'x64'
146-
configuration: 'Release'
147-
- script: |
148-
cd build.common\Release\Binaries\Release
149-
.\test_runner.exe *test.dll
150-
displayName: 'Run tests, release'
151-
- job: Windows_VS2017_UWP
152-
pool:
153-
vmImage: 'vs2017-win2016'
154-
steps:
155-
- script: .\vcpkg\bootstrap-vcpkg.bat
156-
displayName: Bootstrap vcpkg
157-
- script: .\vcpkg\vcpkg.exe install zlib --triplet x64-uwp --vcpkg-root .\vcpkg
158-
displayName: vcpkg install dependencies
159-
- script: mkdir build.common
160-
displayName: Make Build Directory
161-
- task: CMake@1
162-
inputs:
163-
workingDirectory: 'build.common'
164-
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 ..'
165-
- task: MSBuild@1
166-
inputs:
167-
solution: 'build.common/ALL_BUILD.vcxproj'
168-
maximumCpuCount: true
169-
platform: 'x64'
170-
- job: Windows_VS2015_x86
171-
pool:
172-
vmImage: 'vs2015-win2012r2'
173-
steps:
174-
- script: .\vcpkg\bootstrap-vcpkg.bat
175-
displayName: Bootstrap vcpkg
176-
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --vcpkg-root .\vcpkg
177-
displayName: vcpkg install dependencies
178-
- script: mkdir build.common
179-
displayName: Make Build Directory
180-
- task: CMake@1
181-
inputs:
182-
workingDirectory: 'build.common'
183-
cmakeArgs: '-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
184-
- task: MSBuild@1
185-
inputs:
186-
solution: 'build.common/ALL_BUILD.vcxproj'
187-
maximumCpuCount: true
188-
- script: |
189-
cd build.common\Release\Binaries\Debug
190-
.\test_runner.exe *testd.dll
191-
displayName: 'Run tests, debug'
192-
- task: MSBuild@1
193-
inputs:
194-
solution: 'build.common/ALL_BUILD.vcxproj'
195-
maximumCpuCount: true
196-
configuration: 'Release'
197-
- script: |
198-
cd build.common\Release\Binaries\Release
199-
.\test_runner.exe *test.dll
200-
displayName: 'Run tests, release'
201-
- job: Windows_VS2015_x64
202-
pool:
203-
vmImage: 'vs2015-win2012r2'
204-
steps:
205-
- script: .\vcpkg\bootstrap-vcpkg.bat
206-
displayName: Bootstrap vcpkg
207-
- script: .\vcpkg\vcpkg.exe install zlib openssl boost-system boost-date-time boost-regex boost-interprocess websocketpp brotli --triplet x64-windows --vcpkg-root .\vcpkg
208-
displayName: vcpkg install dependencies
209-
- script: mkdir build.common
210-
displayName: Make Build Directory
211-
- task: CMake@1
212-
inputs:
213-
workingDirectory: 'build.common'
214-
cmakeArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DCPPREST_EXCLUDE_BROTLI=OFF ..'
215-
- task: MSBuild@1
216-
inputs:
217-
solution: 'build.common/ALL_BUILD.vcxproj'
218-
maximumCpuCount: true
219-
platform: 'x64'
220-
- script: |
221-
cd build.common\Release\Binaries\Debug
222-
.\test_runner.exe *testd.dll
223-
displayName: 'Run tests, debug'
224-
- task: MSBuild@1
225-
inputs:
226-
solution: 'build.common/ALL_BUILD.vcxproj'
227-
maximumCpuCount: true
228-
platform: 'x64'
229-
configuration: 'Release'
230-
- script: |
231-
cd build.common\Release\Binaries\Release
232-
.\test_runner.exe *test.dll
233-
displayName: 'Run tests, release'
23453
- job: Ubuntu_1604_Apt
23554
pool:
23655
vmImage: 'Ubuntu 16.04'

0 commit comments

Comments
 (0)