|
31 | 31 | $conf32 = "`r`n""i[3-6]86-.*-windows-msvc"":" + $conf32.Substring($conf32.IndexOf("`r`ndefault:") + 10)
|
32 | 32 | $conf32 = $conf32.Substring(0, $conf32.IndexOf("`r`n};`r`n") + 6)
|
33 | 33 | $conf32 = $conf32.Replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib32')
|
34 |
| - Add-Content etc\ldc2.conf $conf32 |
| 34 | + Add-Content etc\ldc2.conf $conf32 -NoNewline |
35 | 35 | cat etc\ldc2.conf
|
36 | 36 |
|
37 | 37 | - name: Generate hello.d
|
|
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: | |
| 86 | + set -eux |
| 87 | + cp -R build-libs-arm64/lib ldc2-multilib/libarm64 |
| 88 | + rm ldc2-multilib/libarm64/*.{exp,ilk} |
| 89 | + rm ldc2-multilib/libarm64/{druntime,phobos2}-ldc-shared.pdb |
| 90 | + - name: Add arm64 section to ldc2.conf |
| 91 | + shell: pwsh |
| 92 | + run: | |
| 93 | + cd ldc2-multilib |
| 94 | + $conf64 = cat etc\ldc2.conf -Raw |
| 95 | + $conf64 = "`r`n""(aarch|arm)64-.*-windows-msvc"":" + $conf64.Substring($conf64.IndexOf("`r`ndefault:") + 10) |
| 96 | + $conf64 = $conf64.Substring(0, $conf64.IndexOf("`r`n};`r`n") + 6) |
| 97 | + $conf64 = $conf64.Replace('%%ldcbinarypath%%/../lib64', '%%ldcbinarypath%%/../libarm64') |
| 98 | + Add-Content etc\ldc2.conf $conf64 -NoNewline |
| 99 | + cat etc\ldc2.conf |
| 100 | + - name: Run arm64 hello-world cross-compilation smoke tests |
| 101 | + shell: cmd |
| 102 | + run: | |
| 103 | + echo on |
| 104 | + call "%VSDIR%\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x64 || exit /b |
| 105 | + echo on |
| 106 | + ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc hello.d || exit /b |
| 107 | + ldc2-multilib\bin\ldc2 -mtriple=aarch64-windows-msvc -link-defaultlib-shared hello.d || exit /b |
| 108 | +
|
66 | 109 | - name: Pack multilib package
|
67 | 110 | shell: bash
|
68 | 111 | run: |
|
|
0 commit comments