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
13 changes: 9 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ jobs:
build: |
export XWIN_CACHE_DIR="$(pwd)/.xwin"
export XWIN_ARCH=aarch64
export PATH="$(brew --prefix llvm)/bin:$PATH"
# Keep this dir ahead of Homebrew llvm so CMAKE_AR=llvm-lib (from cargo-xwin)
# hits packages/binding/xwin-msvc-ar/llvm-lib. libavif 1.4 then can MRI-merge
# avif.lib via llvm-ar -M; brew llvm stays on PATH so cargo-xwin does not
# prepend it in front of the wrapper.
export PATH="$(pwd)/packages/binding/xwin-msvc-ar:$(brew --prefix llvm)/bin:$PATH"
clang --version
CFLAGS="-mneon /FIintrin.h" yarn workspace @napi-rs/image build -x --features with_simd --target aarch64-pc-windows-msvc
- host: macos-latest
Expand All @@ -66,7 +70,8 @@ jobs:
export CFLAGS="-mavx2 -mpclmul /FIintrin.h"
export CXXFLAGS="-mavx2 -mpclmul"
export CARGO_PROFILE_RELEASE_LTO="false"
export PATH="$(brew --prefix llvm)/bin:$PATH"
# Same llvm-lib MRI wrapper as aarch64-pc-windows-msvc (see comment there).
export PATH="$(pwd)/packages/binding/xwin-msvc-ar:$(brew --prefix llvm)/bin:$PATH"
clang --version
yarn workspace @napi-rs/image build -x --features with_simd --target i686-pc-windows-msvc
target: i686-pc-windows-msvc
Expand Down Expand Up @@ -274,7 +279,7 @@ jobs:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: 'v4.5.0'
cmake-version: 'v4.5.1'
- name: Setup node
uses: actions/setup-node@v7
with:
Expand Down Expand Up @@ -311,7 +316,7 @@ jobs:
- uses: actions/checkout@v7
- name: Build
id: build
uses: cross-platform-actions/action@v1.7.0
uses: cross-platform-actions/action@v1.8.0
env:
DEBUG: 'napi:*'
RUSTUP_HOME: /home/runner/rustup
Expand Down
2 changes: 1 addition & 1 deletion packages/binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fast_image_resize = { version = "6", features = ["image"] }
image = { version = "0.25", default-features = false, features = ["jpeg", "ico", "png", "pnm", "tga", "tiff", "bmp", "webp", "hdr", "dds"] }
jpeg-decoder = "0.3"
jxl = { version = "0.8.0", optional = true }
libavif = { version = "0.14", default-features = false, features = ["codec-aom"] }
libavif = { version = "0.15", default-features = false, features = ["codec-aom"] }
libc = "0.2"
lodepng = "3"
moxcms = { version = "0.9.0", optional = true, features = ["extended_range"] }
Expand Down
26 changes: 26 additions & 0 deletions packages/binding/xwin-msvc-ar/llvm-lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
# cargo-xwin sets CMAKE_AR=llvm-lib for clang-cl. libavif 1.4's
# merge_static_libs.cmake matches CMAKE_C_COMPILER_ID Clang before MSVC,
# so it merges static libs with GNU ar MRI (`${CMAKE_AR} -M <script.ar`).
# llvm-lib rejects -M ("ignoring unknown argument") and writes no avif.lib.
# Forward MRI mode to llvm-ar; keep llvm-lib for /out: archive creation.
set -eu
HERE="$(CDPATH= cd -- "$(dirname "$0")" && pwd)"
if [ "${1:-}" = "-M" ]; then
exec llvm-ar "$@"
fi
NEWPATH=""
OLDIFS=$IFS
IFS=:
for p in $PATH; do
[ "$p" = "$HERE" ] && continue
if [ -z "$NEWPATH" ]; then
NEWPATH="$p"
else
NEWPATH="$NEWPATH:$p"
fi
done
IFS=$OLDIFS
PATH="$NEWPATH"
export PATH
exec llvm-lib "$@"
Loading