Skip to content

Commit 659bdb0

Browse files
committedFeb 15, 2021
fix(makefile) If LLVM 10 and 11 are available, do not duplicate the llvm value inside compilers.
This patch removes a possible duplication of the `llvm` value insode the `compilers` variable if both LLVM 10 and 11 are available. This patch also checks for LLVM 11 before LLVM 10.
1 parent adb7c59 commit 659bdb0

File tree

1 file changed

+25
-8
lines changed

1 file changed

+25
-8
lines changed
 

‎Makefile

+25-8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ SHELL=/bin/bash
6767
# | | | | Object File | glibc | yes |
6868

6969

70+
#####
71+
#
72+
# Define the “Platform” and “Architecture” columns of the matrix.
73+
#
74+
#####
75+
76+
7077
IS_DARWIN := 0
7178
IS_LINUX := 0
7279
IS_WINDOWS := 0
@@ -98,29 +105,39 @@ else
98105
LIBC ?= $(shell ldd 2>&1 | grep -o musl | head -n1)
99106
endif
100107

108+
109+
#####
110+
#
111+
# Define the “Compiler” column of the matrix.
112+
#
113+
#####
114+
115+
101116
# Which compilers we build. These have dependencies that may not be on the system.
102117
compilers := cranelift
103118

104-
# In the form "$(compiler)-$(engine)" which compiler+engine combinations to test
119+
# Compilers to test again.
120+
#
121+
# In the form "$(compiler)-$(engine)" which `compiler` and `engine` combinations to test
105122
# in `make test`.
106123
test_compilers_engines :=
107124

108-
# Autodetect LLVM from llvm-config
125+
# Autodetect LLVM from `llvm-config`
109126
ifneq (, $(shell which llvm-config 2>/dev/null))
110127
LLVM_VERSION := $(shell llvm-config --version)
128+
111129
# If findstring is not empty, then it have found the value
112-
ifneq (, $(findstring 10,$(LLVM_VERSION)))
113-
compilers += llvm
114-
endif
115130
ifneq (, $(findstring 11,$(LLVM_VERSION)))
116131
compilers += llvm
117-
endif
118-
else
119-
ifneq (, $(shell which llvm-config-10 2>/dev/null))
132+
else ifneq (, $(findstring 10,$(LLVM_VERSION)))
120133
compilers += llvm
121134
endif
135+
# Autodetect LLVM from `llvm-config-<version>`.
136+
else
122137
ifneq (, $(shell which llvm-config-11 2>/dev/null))
123138
compilers += llvm
139+
else ifneq (, $(shell which llvm-config-10 2>/dev/null))
140+
compilers += llvm
124141
endif
125142
endif
126143

0 commit comments

Comments
 (0)
Please sign in to comment.