Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,39 @@ jobs:
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

prebuild-windows-arm64:
name: Prebuild for Windows arm64
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Rust Nightly
run: |
rustup toolchain install nightly-2023-10-05
rustup target add aarch64-pc-windows-msvc --toolchain nightly-2023-10-05

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64_arm64

- name: Build
shell: bash
run: |
cd core
export CI_MAYBE_TARGET="aarch64-pc-windows-msvc" && export CI_GCC="clang" && make loadable
cd dist && 7z a crsqlite.zip crsqlite.dll

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core/dist/crsqlite.zip
asset_name: crsqlite-win-aarch64.zip
tag: ${{ github.ref }}

prebuild-windows-i686:
name: Prebuild for Windows i686
runs-on: ${{ matrix.os }}
Expand Down
19 changes: 17 additions & 2 deletions core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ CC:=$(CI_GCC)
endif

# SHARED_CFLAGS=-DLIBSQL=1
LOADABLE_CFLAGS=-std=c99 -fPIC -shared -Wall $(SHARED_CFLAGS)
STATIC_CFLAGS=-std=c99 -fPIC -c -Wall $(SHARED_CFLAGS)
PIC_CFLAG=-fPIC
LOADABLE_CFLAGS=-std=c99 $(PIC_CFLAG) -shared -Wall $(SHARED_CFLAGS)
STATIC_CFLAGS=-std=c99 $(PIC_CFLAG) -c -Wall $(SHARED_CFLAGS)
# libsql_feature=,libsql

ifeq ($(shell uname -s),Darwin)
Expand Down Expand Up @@ -42,6 +43,12 @@ C_TARGET=
LOADABLE_EXTENSION=dll
rs_build_flags = -Zbuild-std
endif
ifeq ($(CI_MAYBE_TARGET),aarch64-pc-windows-msvc)
C_TARGET=--target=aarch64-pc-windows-msvc
LOADABLE_EXTENSION=dll
# Windows code is always position independent, clang rejects -fPIC there.
PIC_CFLAG=
endif

ifdef IOS_TARGET
CI_MAYBE_TARGET=$(IOS_TARGET)
Expand Down Expand Up @@ -163,6 +170,14 @@ ifdef CI_MAYBE_TARGET
endif
endif

# MSVC targets emit crsql_<bundle>.lib rather than libcrsql_<bundle>.a
ifeq ($(findstring windows-msvc,$(CI_MAYBE_TARGET)),windows-msvc)
rs_lib_static = ./rs/$(bundle)/target/$(CI_MAYBE_TARGET)/release/crsql_$(bundle).lib
rs_lib_static_cpy = ./dist/crsql_$(bundle)-static.lib
rs_lib_loadable = ./rs/$(bundle)/target/$(CI_MAYBE_TARGET)/release/crsql_$(bundle).lib
rs_lib_loadable_cpy = ./dist/crsql_$(bundle)-loadable.lib
endif

$(shell.c):
cd $(sqlite_src) && make shell.c

Expand Down