# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # # http://go.microsoft.com/fwlink/?LinkId=248926 # Builds the library using CMake. schedules: - cron: "0 5 * * *" displayName: 'Nightly build' branches: include: - main trigger: branches: include: - main paths: exclude: - '*.md' - LICENSE - '.nuget/*' - build/*.json - build/*.props - build/*.ps1 - build/*.targets pr: branches: include: - main paths: exclude: - '*.md' - LICENSE - '.nuget/*' - build/*.json - build/*.props - build/*.ps1 - build/*.targets drafts: false resources: repositories: - repository: self type: git ref: refs/heads/main name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) variables: VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake' GITHUB_PAT: $(GITHUBPUBLICTOKEN) VS_GENERATOR: 'Visual Studio 16 2019' WIN10_SDK: '10.0.19041.0' WIN11_SDK: '10.0.22000.0' pool: vmImage: windows-2019 jobs: - job: CMAKE_BUILD displayName: CMake using VS Generator steps: - checkout: self clean: true fetchTags: false - task: CMake@1 displayName: 'CMake (MSVC): Config x64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=OFF' - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Release' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out -v --config RelWithDebInfo - task: CMake@1 displayName: 'CMake (MSVC): Config x86' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A Win32 -B out2 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=OFF' - task: CMake@1 displayName: 'CMake (MSVC): Build x86 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out2 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC): Build x86 Release' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out2 -v --config RelWithDebInfo - task: CMake@1 displayName: 'CMake (MSVC): Config ARM64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A ARM64 -B out3 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=OFF' - task: CMake@1 displayName: 'CMake (MSVC): Build ARM64 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out3 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC): Build ARM64 Release' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out3 -v --config RelWithDebInfo - task: CMake@1 displayName: 'CMake (UWP): Config x64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out4 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0' - task: CMake@1 displayName: 'CMake (UWP): Build x64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out4 -v - task: CMake@1 displayName: 'CMake (ClangCl): Config x64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -T clangcl -B out6 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)' - task: CMake@1 displayName: 'CMake (ClangCl): Build x64 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out6 -v --config Debug - task: CMake@1 displayName: 'CMake (ClangCl): Build x64 Release' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out6 -v --config RelWithDebInfo - task: CMake@1 displayName: 'CMake (ClangCl): Config ARM64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A ARM64 -T clangcl -B out7 -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK)' - task: CMake@1 displayName: 'CMake (ClangCl): Build ARM64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out7 -v --config Debug - task: CMake@1 displayName: 'CMake (Win10): Config' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out8 -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=ON' - task: CMake@1 displayName: 'CMake (Win10): Build' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out8 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC Spectre): Config x64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out9 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=OFF' - task: CMake@1 displayName: 'CMake (MSVC Spectre): Build x64 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out9 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC Spectre): Build x64 Release' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out9 -v --config RelWithDebInfo - task: CMake@1 displayName: 'CMake (MSVC Spectre): Config ARM64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A ARM64 -B out10 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=OFF' - task: CMake@1 displayName: 'CMake (MSVC Spectre): Build ARM64 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out10 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC Spectre): Build ARM64 Release' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out10 -v --config RelWithDebInfo - task: CMake@1 displayName: 'CMake (Win10 Spectre): Config' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out11 -DENABLE_SPECTRE_MITIGATION=ON -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK) -DBUILD_DX12=ON' - task: CMake@1 displayName: 'CMake (Win10 Spectre): Build' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out11 -v --config Debug - task: CMake@1 displayName: 'CMake (NO_WCHAR_T): Config' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out12 -DNO_WCHAR_T=ON -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) -DBUILD_DX12=ON' - task: CMake@1 displayName: 'CMake (NO_WCHAR_T): Build' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out12 -v --config Debug - job: CMAKE_BUILD_VCPKG displayName: CMake using VCPKG steps: - checkout: self clean: true fetchTags: false - task: CmdLine@2 # We can use the preinstalled vcpkg instead of the latest when MS Hosted updates their vcpkg to the newer DirectX-Headers displayName: Fetch VCPKG inputs: script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/microsoft/vcpkg.git workingDirectory: $(Build.SourcesDirectory) - task: CmdLine@2 displayName: VCPKG Bootstrap inputs: script: call bootstrap-vcpkg.bat workingDirectory: $(Build.SourcesDirectory)\vcpkg - task: CmdLine@2 displayName: VCPKG install headers inputs: script: | call vcpkg install directxmath @if ERRORLEVEL 1 goto error call vcpkg install directx-headers @if ERRORLEVEL 1 goto error call vcpkg install openexr @if ERRORLEVEL 1 goto error call vcpkg install libpng @if ERRORLEVEL 1 goto error call vcpkg install libjpeg-turbo @if ERRORLEVEL 1 goto error :finish @echo --- VCPKG COMPLETE --- exit /b 0 :error @echo --- ERROR: VCPKG FAILED --- exit /b 1 workingDirectory: $(Build.SourcesDirectory)\vcpkg - task: CMake@1 displayName: 'CMake (MSVC): Config x64' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)' - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Debug' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC): Config x64 w/ OpenEXR' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out2 -DENABLE_OPENEXR_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)' - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Debug w/ OpenEXR' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out2 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC): Config x64 w/ libjpeg' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out3 -DENABLE_LIBJPEG_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)' - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Debug w/ libjpeg' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out3 -v --config Debug - task: CMake@1 displayName: 'CMake (MSVC): Config x64 w/ libpng' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out4 -DENABLE_LIBPNG_SUPPORT=ON -DBUILD_TESTING=OFF -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DCMAKE_SYSTEM_VERSION=$(WIN10_SDK)' - task: CMake@1 displayName: 'CMake (MSVC): Build x64 Debug w/ libpng' inputs: cwd: '$(Build.SourcesDirectory)' cmakeArgs: --build out4 -v --config Debug