From 80f4883438f8b1f562634dc351645daf569fe98b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 24 Nov 2022 11:52:08 +0100 Subject: [PATCH 1/2] Change LLVM detection in Makefile --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 1855a1d06c8..8c2815e8da3 100644 --- a/Makefile +++ b/Makefile @@ -122,16 +122,6 @@ ifneq ($(ENABLE_LLVM), 0) ifeq ($(ENABLE_LLVM), 1) LLVM_VERSION := $(shell llvm-config --version) compilers += llvm - # … otherwise, we try to autodetect LLVM from `llvm-config` - else ifneq (, $(shell which llvm-config 2>/dev/null)) - LLVM_VERSION := $(shell llvm-config --version) - - # If findstring is not empty, then it have found the value - ifneq (, $(findstring 13,$(LLVM_VERSION))) - compilers += llvm - else ifneq (, $(findstring 12,$(LLVM_VERSION))) - compilers += llvm - endif # … or try to autodetect LLVM from `llvm-config-`. else ifneq (, $(shell which llvm-config-13 2>/dev/null)) @@ -140,6 +130,16 @@ ifneq ($(ENABLE_LLVM), 0) else ifneq (, $(shell which llvm-config-12 2>/dev/null)) LLVM_VERSION := $(shell llvm-config-12 --version) compilers += llvm + # … otherwise, we try to autodetect LLVM from `llvm-config` + else ifneq (, $(shell which llvm-config 2>/dev/null)) + LLVM_VERSION := $(shell llvm-config --version) + + # If findstring is not empty, then it have found the value + ifneq (, $(findstring 13,$(LLVM_VERSION))) + compilers += llvm + else ifneq (, $(findstring 12,$(LLVM_VERSION))) + compilers += llvm + endif endif endif endif From 2d3a325cddd69b14ffc9d5b1554082a617584253 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 24 Nov 2022 13:03:23 +0100 Subject: [PATCH 2/2] Simplified a bit the if sequence for LLVM makefile detection --- Makefile | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 8c2815e8da3..9333c54e6f6 100644 --- a/Makefile +++ b/Makefile @@ -117,33 +117,31 @@ endif ## # If the user didn't disable the LLVM compiler… -ifneq ($(ENABLE_LLVM), 0) +ifeq ($(ENABLE_LLVM), 0) + LLVM_VERSION := # … then maybe the user forced to enable the LLVM compiler. - ifeq ($(ENABLE_LLVM), 1) - LLVM_VERSION := $(shell llvm-config --version) - compilers += llvm +else ifeq ($(ENABLE_LLVM), 1) + LLVM_VERSION := $(shell llvm-config --version) + compilers += llvm # … or try to autodetect LLVM from `llvm-config-`. - else - ifneq (, $(shell which llvm-config-13 2>/dev/null)) - LLVM_VERSION := $(shell llvm-config-13 --version) - compilers += llvm - else ifneq (, $(shell which llvm-config-12 2>/dev/null)) - LLVM_VERSION := $(shell llvm-config-12 --version) - compilers += llvm - # … otherwise, we try to autodetect LLVM from `llvm-config` - else ifneq (, $(shell which llvm-config 2>/dev/null)) - LLVM_VERSION := $(shell llvm-config --version) - - # If findstring is not empty, then it have found the value - ifneq (, $(findstring 13,$(LLVM_VERSION))) - compilers += llvm - else ifneq (, $(findstring 12,$(LLVM_VERSION))) - compilers += llvm - endif - endif +else ifneq (, $(shell which llvm-config-13 2>/dev/null)) + LLVM_VERSION := $(shell llvm-config-13 --version) + compilers += llvm +else ifneq (, $(shell which llvm-config-12 2>/dev/null)) + LLVM_VERSION := $(shell llvm-config-12 --version) + compilers += llvm + # … otherwise, we try to autodetect LLVM from `llvm-config` +else ifneq (, $(shell which llvm-config 2>/dev/null)) + LLVM_VERSION := $(shell llvm-config --version) + ifneq (, $(findstring 13,$(LLVM_VERSION))) + compilers += llvm + else ifneq (, $(findstring 12,$(LLVM_VERSION))) + compilers += llvm endif endif +# If findstring is not empty, then it have found the value + exclude_tests := --exclude wasmer-c-api --exclude wasmer-cli --exclude wasmer-compiler-cli # Is failing to compile in Linux for some reason exclude_tests += --exclude wasmer-wasi-experimental-io-devices