Skip to content

Commit 9da48e8

Browse files
committed
CI: Bundle arm64 libraries with Windows multilib package
1 parent ae47998 commit 9da48e8

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/actions/merge-windows/action.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,45 @@ runs:
6363
set PATH=%CD%\ldc2-multilib\lib32;%PATH%
6464
ldc2-multilib\bin\ldc2 -link-defaultlib-shared -m32 -run hello.d || exit /b
6565
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+
66105
- name: Pack multilib package
67106
shell: bash
68107
run: |

packaging/windows_installer.iss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,16 @@ SolidCompression=yes
2929
Name: "english"; MessagesFile: "compiler:Default.isl"
3030

3131
[Files]
32-
Source: "{#LDCDir}\*"; Excludes: "\lib32,\lib64"; DestDir: "{app}"; Components: core; Flags: ignoreversion recursesubdirs
32+
Source: "{#LDCDir}\*"; Excludes: "\lib32,\lib64,\libarm64"; DestDir: "{app}"; Components: core; Flags: ignoreversion recursesubdirs
3333
Source: "{#LDCDir}\lib64\*"; DestDir: "{app}\lib64"; Components: lib64; Flags: ignoreversion recursesubdirs
3434
Source: "{#LDCDir}\lib32\*"; DestDir: "{app}\lib32"; Components: lib32; Flags: ignoreversion recursesubdirs
35+
Source: "{#LDCDir}\libarm64\*"; DestDir: "{app}\libarm64"; Components: libarm64; Flags: ignoreversion recursesubdirs
3536

3637
[Components]
3738
Name: core; Description: "Executables, config file and imports"; Types: full compact custom; Flags: fixed
3839
Name: lib64; Description: "x64 libraries"; Types: full compact
3940
Name: lib32; Description: "x86 libraries"; Types: full
41+
Name: libarm64; Description: "arm64 libraries"; Types: full
4042

4143
[Run]
4244
; note: not added to PATH for silent installs with /SILENT or /VERYSILENT

0 commit comments

Comments
 (0)