Skip to content

Commit 83cc297

Browse files
committed
Check the llvm version against a fixed list.
This change is thanks to Peter Hull, who independently resolved the 2.8 vs 2.8svn issue this way. His patch checked the version string against a fixed set of options, which is easier to read and simpler to adjust in the future.
1 parent 8af7360 commit 83cc297

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,13 @@ endif
168168
ifneq ($(CFG_LLVM_CONFIG),)
169169
CFG_LLVM_VERSION := $(shell $(CFG_LLVM_CONFIG) --version)
170170
$(info cfg: found llvm-config at $(CFG_LLVM_CONFIG))
171-
ifneq ($(findstring 2.8,$(CFG_LLVM_VERSION)),)
172-
$(info cfg: using LLVM version $(CFG_LLVM_VERSION))
173-
else ifneq ($(findstring 2.9,$(CFG_LLVM_VERSION)),)
171+
CFG_LLVM_ALLOWED_VERSIONS := 2.8svn 2.8 2.9svn
172+
ifneq ($(findstring $(CFG_LLVM_VERSION),$(CFG_LLVM_ALLOWED_VERSIONS)),)
174173
$(info cfg: using LLVM version $(CFG_LLVM_VERSION))
175174
else
176175
CFG_LLVM_CONFIG :=
177176
$(info cfg: incompatible LLVM version $(CFG_LLVM_VERSION), \
178-
expected 2.8)
177+
expected one of $(CFG_LLVM_ALLOWED_VERSIONS)
179178
endif
180179
endif
181180
ifneq ($(CFG_LLVM_CONFIG),)

0 commit comments

Comments
 (0)