Skip to content

Commit 47fd1c9

Browse files
authored
build: make -no_warn_duplicate_libraries conditional on Xcode >= 15 (algorand#6074)
1 parent 75bb6a9 commit 47fd1c9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ else
4949
export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
5050
endif
5151

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

0 commit comments

Comments
 (0)