1010
1111variables :
1212 solution : ' **/*.sln'
13- buildPlatform : ' x64|ARM '
13+ buildPlatform : ' x64' # Set to x64 or ARM64 depending on the build you want
1414 buildConfiguration : ' Release'
1515 VCPKG_ROOT : ' $(Build.SourcesDirectory)\vcpkg'
1616 VCPKG_CMAKE_OPTIONS : ' -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_ROOT)\scripts\buildsystems\vcpkg.cmake'
3030 .\bootstrap-vcpkg.bat
3131 .\vcpkg.exe integrate install # Integrate vcpkg with MSBuild
3232
33- # Install Boost JSON
33+ # Install Boost JSON for the selected platform (x64 or ARM64)
3434 - task : PowerShell@2
3535 displayName : ' Install Boost JSON'
3636 inputs :
@@ -40,20 +40,34 @@ jobs:
4040 Write-Error "vcpkg.exe not found. Exiting..."
4141 exit 1
4242 }
43- Write-Host "Installing Boost JSON..."
44- & "$(VCPKG_ROOT)\vcpkg.exe" install boost-json:x64-windows
43+ Write-Host "Installing Boost JSON for platform: $(buildPlatform)..."
44+ if ('$(buildPlatform)' -eq 'x64') {
45+ & "$(VCPKG_ROOT)\vcpkg.exe" install boost-json:x64-windows
46+ } elseif ('$(buildPlatform)' -eq 'ARM64') {
47+ & "$(VCPKG_ROOT)\vcpkg.exe" install boost-json:arm64-windows
48+ } else {
49+ Write-Error "Unsupported build platform: $(buildPlatform)"
50+ exit 1
51+ }
4552
4653 # Verify vcpkg integration
4754 - task : PowerShell@2
4855 displayName : ' Verify vcpkg Integration'
4956 inputs :
5057 targetType : ' inline'
5158 script : |
52- echo "Verifying vcpkg integration..."
53- $(VCPKG_ROOT)\vcpkg.exe integrate install
54- if (!(Test-Path "$(VCPKG_ROOT)\installed\x64-windows\include\boost\json.hpp")) {
55- Write-Error "Boost JSON header not found. Exiting..."
56- exit 1
59+ echo "Verifying vcpkg integration for platform: $(buildPlatform)..."
60+ & "$(VCPKG_ROOT)\vcpkg.exe" integrate install
61+ if ('$(buildPlatform)' -eq 'x64') {
62+ if (!(Test-Path "$(VCPKG_ROOT)\installed\x64-windows\include\boost\json.hpp")) {
63+ Write-Error "Boost JSON header not found for x64. Exiting..."
64+ exit 1
65+ }
66+ } elseif ('$(buildPlatform)' -eq 'ARM64') {
67+ if (!(Test-Path "$(VCPKG_ROOT)\installed\arm64-windows\include\boost\json.hpp")) {
68+ Write-Error "Boost JSON header not found for ARM64. Exiting..."
69+ exit 1
70+ }
5771 }
5872 Write-Output "vcpkg integration verified."
5973
@@ -65,12 +79,11 @@ jobs:
6579 script : |
6680 $x86SdkPath = "C:\Program Files (x86)\Windows Kits\10\Include"
6781 $x64SdkPath = "C:\Program Files\Windows Kits\10\Include"
68-
82+ $armSdkPath = "C:\Program Files\Windows Kits\10\Include\arm64"
83+
6984 function Get-SdkVersion {
7085 param ($sdkPath)
71-
7286 $sdkVersion = Get-ChildItem $sdkPath | Where-Object { $_.PSIsContainer -and $_.Name -match '^\d+\.\d+' } | Sort-Object -Property Name | Select-Object -Last 1
73-
7487 return $sdkVersion
7588 }
7689
7992 $sdkFolder = Get-SdkVersion -sdkPath $x64SdkPath
8093 } elseif (Test-Path $x86SdkPath) {
8194 $sdkFolder = Get-SdkVersion -sdkPath $x86SdkPath
95+ } elseif (Test-Path $armSdkPath) {
96+ $sdkFolder = Get-SdkVersion -sdkPath $armSdkPath
8297 }
8398
8499 if ($sdkFolder) {
@@ -89,44 +104,47 @@ jobs:
89104 exit 1
90105 }
91106
92- # Configure CMake
107+ # Configure CMake based on selected platform
93108 - task : CMake@1
94109 displayName : ' Configure CMake'
95110 inputs :
96111 workingDirectory : ' $(Build.SourcesDirectory)\LogMonitor'
97112 cmakeArgs : |
98- -A x64 -S $(Build.SourcesDirectory)\LogMonitor -B $(Build.BinariesDirectory)\LogMonitor\x64
113+ -A $(buildPlatform) -S $(Build.SourcesDirectory)\LogMonitor -B $(Build.BinariesDirectory)\LogMonitor\$(buildPlatform)
99114
100115 - task : CMake@1
101116 displayName : ' Build with CMake'
102117 inputs :
103- workingDirectory : ' $(Build.BinariesDirectory)\LogMonitor\x64 '
118+ workingDirectory : ' $(Build.BinariesDirectory)\LogMonitor\$(buildPlatform) '
104119 cmakeArgs : ' --build . --config $(buildConfiguration) --parallel'
105-
120+
121+ # Component Governance
106122 - task : ComponentGovernanceComponentDetection@0
107123 inputs :
108124 scanType : ' Register'
109125 verbosity : ' Verbose'
110126 alertWarningLevel : ' Low'
111127
128+ # Install Visual Studio Test Platform
112129 - task : VisualStudioTestPlatformInstaller@1
113130 inputs :
114131 packageFeedSelector : ' nugetOrg'
115132 versionSelector : ' latestPreRelease'
116133
134+ # Run Tests
117135 - task : VSTest@2
118136 inputs :
119137 testSelector : ' testAssemblies'
120138 testAssemblyVer2 : ' **\*test*.dll'
121- searchFolder : ' $(Build.BinariesDirectory)\LogMonitor\x64\Release \'
139+ searchFolder : ' $(Build.BinariesDirectory)\LogMonitor\$(buildPlatform)\$(buildConfiguration) \'
122140 runOnlyImpactedTests : false
123141 runInParallel : false
124142 rerunFailedTests : true
125143 rerunMaxAttempts : 3
126-
144+
127145 # Publish build artifacts
128146 - task : PublishPipelineArtifact@1
129147 inputs :
130- targetPath : ' $(Build.BinariesDirectory)\LogMonitor\x64\Release \'
148+ targetPath : ' $(Build.BinariesDirectory)\LogMonitor\$(buildPlatform)\$(buildConfiguration) \'
131149 artifactType : ' pipeline'
132- artifactName : ' 64-bit '
150+ artifactName : ' $(buildPlatform)-$(buildConfiguration) '
0 commit comments