Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support windows arm64 #1705

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-arm64
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
))
Loading