Skip to content

Commit

Permalink
Fix compiling on older macOS
Browse files Browse the repository at this point in the history
ranlib errors on older macOS because of arm64 arch in code/libs/macosx/-
libSDL2main.a. Use lipo to extract the library for the specific arch
that is being linked.
  • Loading branch information
zturtleman committed Dec 18, 2024
1 parent be95183 commit 39d02c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,18 @@ ifeq ($(PLATFORM),darwin)

CC=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-cc
RANLIB=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-ranlib
LIPO=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-lipo

ifeq ($(call bin_path, $(CC)),)
$(error Unable to find osxcross $(CC))
endif
endif
endif

ifndef LIPO
LIPO=lipo
endif

BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe

BASE_CFLAGS += -D_THREAD_SAFE=1
Expand Down

0 comments on commit 39d02c1

Please sign in to comment.