|
63 | 63 | set PATH=%CD%\ldc2-multilib\lib32;%PATH% |
64 | 64 | ldc2-multilib\bin\ldc2 -link-defaultlib-shared -m32 -run hello.d || exit /b |
65 | 65 |
|
| 66 | + # preliminary arm64 cross-compilation support |
| 67 | + - name: Install ninja v1.12.1 |
| 68 | + uses: Ahajha/gha-setup-ninja@69595b0cf872acdad8ce599142fbdc88724b9a2b |
| 69 | + - name: 'Set VSDIR env variable' |
| 70 | + shell: bash |
| 71 | + run: echo "VSDIR=$(vswhere -latest -property installationPath)" >> $GITHUB_ENV |
| 72 | + - name: Cross-compile arm64 libraries |
| 73 | + shell: cmd |
| 74 | + run: | |
| 75 | + echo on |
| 76 | + call "%VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x64 || exit /b |
| 77 | + echo on |
| 78 | + ldc2-multilib\bin\ldc-build-runtime --ninja ^ |
| 79 | + --buildDir=build-libs-arm64 ^ |
| 80 | + --dFlags=-mtriple=aarch64-windows-msvc ^ |
| 81 | + "--ldcSrcDir=%CD%" ^ |
| 82 | + BUILD_LTO_LIBS=ON |
| 83 | + - name: Copy arm64 libraries |
| 84 | + shell: bash |
| 85 | + run: cp -R build-libs-arm64/lib ldc2-multilib/libarm64 |
| 86 | + - name: Add arm64 section to ldc2.conf |
| 87 | + shell: pwsh |
| 88 | + run: | |
| 89 | + cd ldc2-multilib |
| 90 | + $conf64 = cat etc\ldc2.conf -Raw |
| 91 | + $conf64 = "`r`n""(aarch|arm)64-.*-windows-msvc"":" + $conf64.Substring($conf64.IndexOf("`r`ndefault:") + 10) |
| 92 | + $conf64 = $conf64.Substring(0, $conf64.IndexOf("`r`n};`r`n") + 6) |
| 93 | + $conf64 = $conf64.Replace('%%ldcbinarypath%%/../lib64', '%%ldcbinarypath%%/../libarm64') |
| 94 | + Add-Content etc\ldc2.conf $conf64 |
| 95 | + cat etc\ldc2.conf |
| 96 | + - name: Run arm64 hello-world cross-compilation smoke tests |
| 97 | + shell: cmd |
| 98 | + run: | |
| 99 | + echo on |
| 100 | + call "%VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x64 || exit /b |
| 101 | + echo on |
| 102 | + ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc hello.d || exit /b |
| 103 | + ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc -link-defaultlib-shared hello.d || exit /b |
| 104 | +
|
66 | 105 | - name: Pack multilib package |
67 | 106 | shell: bash |
68 | 107 | run: | |
|
0 commit comments