File tree Expand file tree Collapse file tree 5 files changed +36
-1
lines changed Expand file tree Collapse file tree 5 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 7272 - name : Build Native Library (Unix)
7373 if : runner.os != 'Windows'
7474 run : deno task build
75+
76+ - name : Build Native Library (macOS x86_64)
77+ if : runner.os == 'macos-latest'
78+ env :
79+ TARGET_ARCH : x86_64
80+ run : |
81+ deno task build-skia
82+ cp ./native/build/libnative_canvas{,_aarch64}.dylib
83+ deno task build-macos-x86_64
7584
7685 - name : Build Native Library (Windows)
7786 if : runner.os == 'Windows'
@@ -102,4 +111,5 @@ jobs:
102111 skia/out/Release/icudtl.dat
103112 native/build/libnative_canvas.so
104113 native/build/libnative_canvas.dylib
114+ native/build/libnative_canvas_aarch64.dylib
105115 native/build/Release/native_canvas.dll
Original file line number Diff line number Diff line change 1+ name : Publish
2+ on :
3+ release
4+
5+ jobs :
6+ publish :
7+ runs-on : ubuntu-latest
8+
9+ permissions :
10+ contents : read
11+ id-token : write
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+
16+ - name : Publish package
17+ run : npx jsr publish
Original file line number Diff line number Diff line change 88
99 "tasks" : {
1010 "build" : " cd native/build && CC=clang CXX=clang++ cmake .. && cmake --build . --config Release" ,
11+ "build-macos-x86_64" : " cd native/build && CC=clang CXX=clang++ cmake .. -DMACOS_TARGET_ARCH=x86_64 && cmake --build . --config Release" ,
1112 "build-win" : " rm -rf native/build && mkdir native/build && cd native/build && cmake .. -G \" Visual Studio 17 2022\" -T ClangCL && cmake --build . --config Release" ,
1213 "test" : " deno run -A --unstable-ffi ./test/test.ts" ,
1314 "test-prebuilt" : " deno run -A --unstable-ffi --import-map=./test/import_map.json ./test/test.ts" ,
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.10.0)
2+
3+ set (MACOS_TARGET_ARCH "arm64" CACHE STRING "macOS target architecture (x86_64, arm64)" )
4+
25project (native_canvas VERSION 0.1.0)
36
47set (CMAKE_CXX_STANDARD 17)
58# set (CMAKE_BUILD_TYPE Debug)
69set (CMAKE_BUILD_TYPE Release)
710
11+ if (APPLE )
12+ set (CMAKE_OSX_ARCHITECTURES ${MACOS_TARGET_ARCH} )
13+ endif ()
14+
815include_directories (. ../skia)
916
1017add_library (native_canvas SHARED
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ if (Deno.env.get("SKIA_FROM_SOURCE") !== "1") {
3131 os = "Linux" ;
3232 break ;
3333 }
34- if ( Deno . build . arch === "aarch64" ) {
34+ if ( ( Deno . env . get ( "TARGET_ARCH" ) || Deno . build . arch ) === "aarch64" ) {
3535 os += "-aarch64" ;
3636 }
3737 try {
You can’t perform that action at this time.
0 commit comments