From bc1295782329fbd6b17e94f72b645af32060ccb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Thu, 2 Jan 2025 09:05:43 +0100 Subject: [PATCH] ci: add ARCH variable to makefile, override it during cross-compilation --- .github/workflows/extensions.yml | 2 +- extensions/Makefile | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/extensions.yml b/.github/workflows/extensions.yml index 922223d9..bf70d038 100644 --- a/.github/workflows/extensions.yml +++ b/.github/workflows/extensions.yml @@ -75,7 +75,7 @@ jobs: export CC=/opt/homebrew/opt/llvm/bin/clang export CFLAGS="-target x86_64-apple-darwin" export LDFLAGS="-target x86_64-apple-darwin" - make + make ARCH=x86_64 - name: Commit output files shell: bash diff --git a/extensions/Makefile b/extensions/Makefile index 17783e8c..798dcb57 100644 --- a/extensions/Makefile +++ b/extensions/Makefile @@ -9,14 +9,15 @@ ifeq ($(OS),Windows_NT) else UNAME := $(shell uname) CCFLAGS += -fPIC -Os -shared + ARCH := $(if $(ARCH),$(ARCH),$(shell uname -m)) ifeq ($(UNAME),Darwin) - ifeq ($(shell uname -m),arm64) + ifeq ($(ARCH),arm64) OUTPUT = lib/arm/noattach.dylib else OUTPUT = lib/noattach.dylib endif else - ifeq ($(shell uname -m),aarch64) + ifeq ($(ARCH),aarch64) OUTPUT = lib/arm/noattach.so else OUTPUT = lib/noattach.so