From 5deb80be2268e841e5f78ff99b656c984321b3f8 Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Sat, 15 Feb 2025 18:13:32 -0800 Subject: [PATCH] use singlke build for mac --- .github/workflows/release.yml | 2 +- CMakeLists.txt | 3 +++ tools/postinstall.js | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 228514c..13b2ff4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -213,5 +213,5 @@ jobs: with: upload_url: ${{ needs.create_release.outputs.upload_url }} asset_path: ./build/Release/node-raylib.node - asset_name: node-raylib-darwin-x64.node + asset_name: node-raylib-darwin.node asset_content_type: application/octet-stream diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fa51eb..8206d69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,9 @@ endif() set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") +# single build for both Mac arches +set(CMAKE_OSX_ARCHITECTURES arm64 x86_64) + # version doesn't seem to pick correct version #find_package(raylib 4.5 QUIET EXACT) if (NOT raylib_FOUND) diff --git a/tools/postinstall.js b/tools/postinstall.js index f619369..07cf9b7 100644 --- a/tools/postinstall.js +++ b/tools/postinstall.js @@ -33,6 +33,11 @@ async function main () { let url = `https://github.com/RobLoach/node-raylib/releases/download/v${process.env.npm_package_version}/node-raylib-${process.platform}-${process.arch}.node` + // we use a single build for both platforms on Mac + if (process.platform === 'darwin') { + url = `https://github.com/RobLoach/node-raylib/releases/download/v${process.env.npm_package_version}/node-raylib-darwin.node` + } + console.log(`Checking for ${url}`) try {