diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000000..eea7b7957e --- /dev/null +++ b/CMakeSettings.json @@ -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": [] + } + ] +} diff --git a/azure-devops/build-windows.yml b/azure-devops/build-windows.yml new file mode 100644 index 0000000000..11b0b9d2c6 --- /dev/null +++ b/azure-devops/build-windows.yml @@ -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' diff --git a/azure-devops/vcpkg-windows.txt b/azure-devops/vcpkg-windows.txt new file mode 100644 index 0000000000..582d18dcdb --- /dev/null +++ b/azure-devops/vcpkg-windows.txt @@ -0,0 +1,7 @@ +openssl +boost-system +boost-date-time +boost-regex +boost-interprocess +websocketpp +brotli diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6cc3aebeda..8fc6f54365 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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' @@ -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'