@@ -9,16 +9,23 @@ public sealed class BuildWindowsTask : FrostingTask<BuildContext>
99
1010 public override void Run ( BuildContext context )
1111 {
12- var buildWorkingDir = "crunch_build/" ;
12+ BuildForArchitecture ( context , "x64" , "windows-x64" ) ;
13+ BuildForArchitecture ( context , "ARM64" , "windows-arm64" ) ;
14+ }
15+
16+ private void BuildForArchitecture ( BuildContext context , string cmakeArch , string rid , string cmakeOptions = "" )
17+ {
18+ var buildWorkingDir = $ "crunch_build_{ rid } ";
1319 Directory . CreateDirectory ( buildWorkingDir ) ;
1420 // Path relative to the buildWorkingDir
1521 var cmakeListsPath = System . IO . Path . Combine ( ".." , "crunch" , "CMakeLists.txt" ) ;
16- context . StartProcess ( "cmake" , new ProcessSettings { WorkingDirectory = buildWorkingDir , Arguments = $ "-DBUILD_CRUNCH=ON -DBUILD_SHARED_LIBCRN=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_EXAMPLES=OFF { cmakeListsPath } " } ) ;
22+ context . StartProcess ( "cmake" , new ProcessSettings { WorkingDirectory = buildWorkingDir , Arguments = $ "{ cmakeOptions } -DBUILD_CRUNCH=ON -DBUILD_SHARED_LIBCRN=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_EXAMPLES=OFF { cmakeListsPath } " } ) ;
1723 context . ReplaceTextInFiles ( "crunch_build/_crunch/crunch.vcxproj" , "MultiThreadedDLL" , "MultiThreaded" ) ;
1824 context . ReplaceTextInFiles ( "crunch_build/crnlib/crn-obj.vcxproj" , "MultiThreadedDLL" , "MultiThreaded" ) ;
1925 context . ReplaceTextInFiles ( "crunch_build/crnlib/crn.vcxproj" , "MultiThreadedDLL" , "MultiThreaded" ) ;
2026 context . StartProcess ( "cmake" , new ProcessSettings { WorkingDirectory = buildWorkingDir , Arguments = "--build . --config release" } ) ;
27+ Directory . CreateDirectory ( $ "{ context . ArtifactsDir } /{ rid } ") ;
2128 var files = Directory . GetFiles ( System . IO . Path . Combine ( buildWorkingDir , "Release" ) , "crunch.exe" , SearchOption . TopDirectoryOnly ) ;
22- context . CopyFile ( files [ 0 ] , $ "{ context . ArtifactsDir } /crunch.exe") ;
29+ context . CopyFile ( files [ 0 ] , $ "{ context . ArtifactsDir } /{ rid } / crunch.exe") ;
2330 }
2431}
0 commit comments