Skip to content

Commit

Permalink
build: Define -arch for host compilers on darwin builders
Browse files Browse the repository at this point in the history
This change fixes cross-compiling on M1 Apple Silicon systems.
  • Loading branch information
hebasto committed Nov 25, 2021
1 parent 7fc298c commit 46cf787
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions depends/builders/darwin.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ build_darwin_SHA256SUM=shasum -a 256
build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o

#darwin host on darwin builder. overrides darwin host preferences.
darwin_CC := $(build_darwin_CC) -mmacosx-version-min=$(OSX_MIN_VERSION)
darwin_CXX := $(build_darwin_CXX) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++
x86_64_darwin_CC := $(build_darwin_CC) -arch x86_64 -mmacosx-version-min=$(OSX_MIN_VERSION)
x86_64_darwin_CXX := $(build_darwin_CXX) -arch x86_64 -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++
aarch64_darwin_CC := $(build_darwin_CC) -arch arm64 -mmacosx-version-min=$(OSX_MIN_VERSION)
aarch64_darwin_CXX := $(build_darwin_CXX) -arch arm64 -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++
darwin_AR:=$(shell xcrun -f ar)
darwin_RANLIB:=$(shell xcrun -f ranlib)
darwin_STRIP:=$(shell xcrun -f strip)
Expand Down

0 comments on commit 46cf787

Please sign in to comment.