Skip to content

Commit

Permalink
Support windows arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Jun 3, 2024
1 parent 641956d commit d886e47
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/binary-combine-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Windows Build Combine

on:
workflow_call:

jobs:
build-windows-combined:
name: Combine Windows binaries
timeout-minutes: 15
runs-on: windows-latest
steps:
- name: Fetch x64 build
uses: actions/download-artifact@v4
with:
name: librealm-windows-x64
path: packages/realm_dart/binary/windows

- name: Fetch arm64 build
uses: actions/download-artifact@v4
with:
name: librealm-windows-arme64
path: packages/realm_dart/binary/windows

- name: Store combined artifact
uses: actions/upload-artifact@v4
with:
name: librealm-windows
path: packages/realm_dart/binary/windows
retention-days: 1

- name: Delete individual build artifacts
uses: geekyeggo/delete-artifact@v4
with:
name: |
librealm-windows-x64
librealm-windows-arm64
failOnError: false
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
runner: windows-latest
binary: windows
build: '["windows"]'
build: '["windows-x64", "windows-arm64"]'

build-macos:
name: Build MacOS
Expand Down Expand Up @@ -55,6 +55,11 @@ jobs:
binary: ios
build: '["ios-device", "ios-simulator"]'

build-windows-combined:
name: Build combine Windows
needs: build-windows
uses: ./.github/workflows/binary-combine-windows.yml

build-android-combined:
name: Build combine Android
needs: build-android
Expand Down
21 changes: 18 additions & 3 deletions packages/realm_dart/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@
"name": "windows",
"inherits": "default",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"condition": {
"lhs": "${hostSystemName}",
"type": "equals",
"rhs": "Windows"
}
},
{
"name": "windows-x64",
"inherits": "windows",
"architecture": "x64"
},
{
"name": "windows-arm64",
"inherits": "windows",
"architecture": "ARM64"
},
{
"name": "macos",
"displayName": "macOS",
Expand Down Expand Up @@ -125,11 +134,17 @@
"configuration": "Debug"
},
{
"name": "windows",
"configurePreset": "windows",
"name": "windows-x64",
"configurePreset": "windows-x64",
"displayName": "x64",
"configuration": "Debug"
},
{
"name": "windows-arm64",
"configurePreset": "windows-arm64",
"displayName": "arm64",
"configuration": "Debug"
},
{
"name": "android-x86_64",
"configurePreset": "android-x86_64",
Expand Down
10 changes: 8 additions & 2 deletions packages/realm_dart/scripts/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
pushd "%~dp0.."
echo %CD%

cmake --preset windows
cmake --build --preset windows --config MinSizeRel
@REM only building for x64 if no arguments
set ABIS=x64 arm64
if [%1]==[] set ABIS=x64

(for %%a in (%ABIS%) do (
cmake --preset windows-%%a
cmake --build --preset windows-%%a --config MinSizeRel
))

0 comments on commit d886e47

Please sign in to comment.