Skip to content

Commit

Permalink
build: make -no_warn_duplicate_libraries conditional on Xcode >= 15 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
cce authored Jul 22, 2024
1 parent 75bb6a9 commit 47fd1c9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ else
export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
endif

# M1 Mac--homebrew install location in /opt/homebrew
ifeq ($(OS_TYPE), darwin)
ifeq ($(ARCH), arm64)
# For Xcode >= 15, set -no_warn_duplicate_libraries linker option
CLANG_MAJOR_VERSION := $(shell clang --version | grep '^Apple clang version ' | awk '{print $$4}' | cut -d. -f1)
ifeq ($(shell [ $(CLANG_MAJOR_VERSION) -ge 15 ] && echo true), true)
EXTLDFLAGS := -Wl,-no_warn_duplicate_libraries
endif
# M1 Mac--homebrew install location in /opt/homebrew
ifeq ($(ARCH), arm64)
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
endif
Expand Down

0 comments on commit 47fd1c9

Please sign in to comment.