Skip to content

Commit c4f37e7

Browse files
authored
Avoid using permissive- with ZW which breaks VS2019 (microsoft#1248)
* Also add VS2019 configurations to Azure Pipelines. * Also turn on vcpkg caching from @lukka
1 parent ce96a31 commit c4f37e7

File tree

6 files changed

+96
-136
lines changed

6 files changed

+96
-136
lines changed

.gitmodules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[submodule "vcpkg"]
22
path = vcpkg
33
url = https://github.com/Microsoft/vcpkg
4-
[submodule "websocketspp"]
4+
[submodule "websocketpp"]
55
path = Release/libs/websocketpp
66
url = https://github.com/zaphoyd/websocketpp/
7+
fetchRecurseSubmodules = false

Release/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
187187

188188
if (WINDOWS_STORE OR WINDOWS_PHONE)
189189
add_compile_options(/ZW)
190-
endif()
191-
192-
if (NOT (MSVC_VERSION LESS 1920))
193-
add_compile_options(/permissive-)
190+
else()
191+
if (NOT (MSVC_VERSION LESS 1920))
192+
add_compile_options(/permissive-)
193+
endif()
194194
endif()
195195
else()
196196
message("-- Unknown compiler, success is doubtful.")

azure-devops/build-windows.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 }} | ${{ parameters.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 (Debug)'
27+
enabled: true
28+
inputs:
29+
cmakeListsOrSettingsJson: 'CMakeListsTxtBasic'
30+
cmakeBuildType: 'Debug'
31+
useVcpkgToolchainFile: true
32+
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}_Debug
33+
cmakeAppendedArgs: '-DCPPREST_EXCLUDE_BROTLI=OFF'
34+
- script: |
35+
cd $(Build.ArtifactStagingDirectory)\${{ parameters.targetPlatform }}_Debug\Release\Binaries
36+
.\test_runner.exe *testd.dll
37+
displayName: 'Run tests, debug'
38+
- task: run-cmake@0
39+
displayName: 'Run CMake with Ninja (Release)'
40+
enabled: true
41+
inputs:
42+
cmakeListsOrSettingsJson: 'CMakeListsTxtBasic'
43+
cmakeBuildType: 'Release'
44+
useVcpkgToolchainFile: true
45+
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}_Release
46+
cmakeAppendedArgs: '-DCPPREST_EXCLUDE_BROTLI=OFF'
47+
- script: |
48+
cd $(Build.ArtifactStagingDirectory)\${{ parameters.targetPlatform }}_Release\Release\Binaries
49+
.\test_runner.exe *test.dll
50+
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: 32 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,39 @@
11
# CppRestSdk Azure Pipelines Configuration
22

33
jobs:
4-
- job: Windows_VS2017_x86
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'
34+
- job: Windows_VS2019_UWP
535
pool:
6-
vmImage: 'vs2017-win2016'
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_VS2017_x64
36-
pool:
37-
vmImage: 'vs2017-win2016'
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'
68-
- job: Windows_VS2017_UWP
69-
pool:
70-
vmImage: 'vs2017-win2016'
36+
vmImage: 'windows-latest'
7137
steps:
7238
- script: .\vcpkg\bootstrap-vcpkg.bat
7339
displayName: Bootstrap vcpkg
@@ -84,70 +50,6 @@ jobs:
8450
solution: 'build.common/ALL_BUILD.vcxproj'
8551
maximumCpuCount: true
8652
platform: 'x64'
87-
- job: Windows_VS2015_x86
88-
pool:
89-
vmImage: 'vs2015-win2012r2'
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_VS2015_x64
119-
pool:
120-
vmImage: 'vs2015-win2012r2'
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'
15153
- job: Ubuntu_1604_Apt
15254
pool:
15355
vmImage: 'Ubuntu 16.04'

vcpkg

Submodule vcpkg updated 2349 files

0 commit comments

Comments
 (0)