Skip to content

Commit 28c1b8b

Browse files
committed
Add windows ARM64 builds support
1 parent d580eef commit 28c1b8b

4 files changed

Lines changed: 17 additions & 33 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,16 @@ jobs:
300300
arch:
301301
- x86
302302
- x64
303+
- arm64
303304
env:
304305
NO_DLL: ${{ github.event.inputs.no_dll }}
305306
BUILD_ARCH: ${{ matrix.arch }}
306-
TOOLSET: '14.39'
307307

308308
# Steps represent a sequence of tasks that will be executed as part of the job
309309
steps:
310310
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
311311
- uses: actions/checkout@v6
312312

313-
# - name: setup-msvc
314-
# shell: pwsh
315-
# run: .\1k\setup-msvc.ps1 -ver $env:TOOLSET -arch $env:BUILD_ARCH
316-
317313
- name: Build
318314
shell: pwsh
319315
run: .\build.ps1 -p win32 -a $env:BUILD_ARCH -libs '${{ github.event.inputs.libs }}'
@@ -337,17 +333,12 @@ jobs:
337333
env:
338334
NO_DLL: ${{ github.event.inputs.no_dll }}
339335
BUILD_ARCH: ${{ matrix.arch }}
340-
TOOLSET: '14.39'
341336

342337
# Steps represent a sequence of tasks that will be executed as part of the job
343338
steps:
344339
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
345340
- uses: actions/checkout@v6
346341

347-
# - name: setup-msvc
348-
# shell: pwsh
349-
# run: .\1k\setup-msvc.ps1 -ver $env:TOOLSET -arch $env:BUILD_ARCH
350-
351342
- name: Build
352343
shell: pwsh
353344
run: .\build.ps1 -p winrt -a $env:BUILD_ARCH -libs '${{ github.event.inputs.libs }}'

1k/dist.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function dist_lib {
8080
if [ "$CONF_TEMPLATE" = "config.h.in" ] ; then
8181
mkdir -p ${DIST_DIR}/include/win-x86/${INC_DIR}
8282
mkdir -p ${DIST_DIR}/include/win-x64/${INC_DIR}
83+
mkdir -p ${DIST_DIR}/include/win-arm64/${INC_DIR}
8384
mkdir -p ${DIST_DIR}/include/winrt-x64/${INC_DIR}
8485
mkdir -p ${DIST_DIR}/include/winrt-arm64/${INC_DIR}
8586
mkdir -p ${DIST_DIR}/include/linux-x64/${INC_DIR}
@@ -124,6 +125,7 @@ function dist_lib {
124125
if [ "$CONF_TEMPLATE" = "config.h.in" ] ; then
125126
cp install_win32_x86/${LIB_NAME}/include/${INC_DIR}${CONF_HEADER} ${DIST_DIR}/include/win-x86/${INC_DIR}
126127
cp install_win32_x64/${LIB_NAME}/include/${INC_DIR}${CONF_HEADER} ${DIST_DIR}/include/win-x64/${INC_DIR}
128+
cp install_win32_arm64/${LIB_NAME}/include/${INC_DIR}${CONF_HEADER} ${DIST_DIR}/include/win-arm64/${INC_DIR}
127129
cp install_winrt_x64/${LIB_NAME}/include/${INC_DIR}${CONF_HEADER} ${DIST_DIR}/include/winrt-x64/${INC_DIR}
128130
cp install_winrt_arm64/${LIB_NAME}/include/${INC_DIR}${CONF_HEADER} ${DIST_DIR}/include/winrt-arm64/${INC_DIR}
129131
cp install_linux_x64/${LIB_NAME}/include/${INC_DIR}${CONF_HEADER} ${DIST_DIR}/include/linux-x64/${INC_DIR}
@@ -158,6 +160,10 @@ function dist_lib {
158160
mkdir -p ${DIST_DIR}/lib/win32/x64
159161
copy1k "install_win32_x64/${LIB_NAME}/lib/*.lib" ${DIST_DIR}/lib/win32/x64/
160162
copy1k "install_win32_x64/${LIB_NAME}/bin/*.dll" ${DIST_DIR}/lib/win32/x64/
163+
164+
mkdir -p ${DIST_DIR}/lib/win32/arm64
165+
copy1k "install_win32_arm64/${LIB_NAME}/lib/*.lib" ${DIST_DIR}/lib/win32/arm64/
166+
copy1k "install_win32_arm64/${LIB_NAME}/bin/*.dll" ${DIST_DIR}/lib/win32/arm64/
161167
fi
162168

163169
if [ $(($DIST_FLAGS & $DISTF_WINRT)) != 0 ]; then

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ for example, if you use git to clone axmol(~80MB) and run it's `setup.ps1`, then
4141
- x86_64
4242
- linux:
4343
- x86_64
44-
- arm64
44+
- arm64 (since v114)
4545
- ios:
4646
- arm64
4747
- arm64 simulator

src/openssl/build1.ps1

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,17 @@ $env:CXX = $null
1313

1414
if ($target_os.StartsWith('win')) {
1515
# require preinstalled perl interpreter: https://strawberryperl.com/releases.html
16-
if ($target_cpu -eq "x86") {
17-
if (!$is_winrt) {
18-
$TARGET_OPTIONS += 'VC-WIN32'
19-
}
20-
else {
21-
$TARGET_OPTIONS += 'VC-WIN32-UWP'
16+
switch($target_cpu) {
17+
'x86' { $ossl_cpu_opt = 'VC-WIN32' }
18+
'x64' { $ossl_cpu_opt = 'VC-WIN64A' }
19+
'arm64' { $ossl_cpu_opt = 'VC-WIN64-ARM' }
20+
default {
21+
throw "Unsupported arch: $target_cpu"
2222
}
2323
}
24-
else {
25-
if (!$is_winrt) {
26-
$TARGET_OPTIONS += 'VC-WIN64A'
27-
}
28-
else {
29-
if ($target_cpu -eq 'x64') {
30-
$TARGET_OPTIONS += 'VC-WIN64A-UWP'
31-
}
32-
elseif ($target_cpu -eq 'arm64') {
33-
$TARGET_OPTIONS += 'VC-WIN64-ARM-UWP'
34-
}
35-
else {
36-
Write-Output "Unsupported arch: $target_cpu"
37-
return 1
38-
}
39-
}
24+
25+
if ($is_winrt) {
26+
$ossl_cpu_opt += '-UWP'
4027
}
4128

4229
if ($env:NO_DLL -eq 'true') {

0 commit comments

Comments
 (0)