Skip to content

Commit

Permalink
Avoid using permissive- with ZW which breaks VS2019 (#1248)
Browse files Browse the repository at this point in the history
* Also add VS2019 configurations to Azure Pipelines.
* Also turn on vcpkg caching from @lukka
  • Loading branch information
BillyONeal authored Sep 27, 2019
1 parent ce96a31 commit c4f37e7
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 136 deletions.
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg
[submodule "websocketspp"]
[submodule "websocketpp"]
path = Release/libs/websocketpp
url = https://github.com/zaphoyd/websocketpp/
fetchRecurseSubmodules = false
8 changes: 4 additions & 4 deletions Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")

if (WINDOWS_STORE OR WINDOWS_PHONE)
add_compile_options(/ZW)
endif()

if (NOT (MSVC_VERSION LESS 1920))
add_compile_options(/permissive-)
else()
if (NOT (MSVC_VERSION LESS 1920))
add_compile_options(/permissive-)
endif()
endif()
else()
message("-- Unknown compiler, success is doubtful.")
Expand Down
50 changes: 50 additions & 0 deletions azure-devops/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 (Debug)'
enabled: true
inputs:
cmakeListsOrSettingsJson: 'CMakeListsTxtBasic'
cmakeBuildType: 'Debug'
useVcpkgToolchainFile: true
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}_Debug
cmakeAppendedArgs: '-DCPPREST_EXCLUDE_BROTLI=OFF'
- script: |
cd $(Build.ArtifactStagingDirectory)\${{ parameters.targetPlatform }}_Debug\Release\Binaries
.\test_runner.exe *testd.dll
displayName: 'Run tests, debug'
- task: run-cmake@0
displayName: 'Run CMake with Ninja (Release)'
enabled: true
inputs:
cmakeListsOrSettingsJson: 'CMakeListsTxtBasic'
cmakeBuildType: 'Release'
useVcpkgToolchainFile: true
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}_Release
cmakeAppendedArgs: '-DCPPREST_EXCLUDE_BROTLI=OFF'
- script: |
cd $(Build.ArtifactStagingDirectory)\${{ parameters.targetPlatform }}_Release\Release\Binaries
.\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
162 changes: 32 additions & 130 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,39 @@
# CppRestSdk Azure Pipelines Configuration

jobs:
- job: Windows_VS2017_x86
- 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: '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'
vmImage: 'windows-latest'
steps:
- script: .\vcpkg\bootstrap-vcpkg.bat
displayName: Bootstrap vcpkg
Expand All @@ -84,70 +50,6 @@ jobs:
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
2 changes: 1 addition & 1 deletion vcpkg
Submodule vcpkg updated 2349 files

0 comments on commit c4f37e7

Please sign in to comment.