Skip to content

Commit

Permalink
feaf(makefile) Add the HAS_<compiler> variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Feb 15, 2021
1 parent 1054e51 commit 07e48b4
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ IS_WINDOWS := 0
IS_AMD64 := 0
IS_AARCH64 := 0
LIBC ?=
HAS_CRANELIFT := 0
HAS_LLVM := 0
HAS_SINGLEPASS := 0

# Test Windows apart because it doesn't support `uname -s`.
ifeq ($(OS), Windows_NT)
Expand Down Expand Up @@ -113,6 +116,7 @@ compilers :=
##

compilers += cranelift
HAS_CRANELIFT := 1

##
# LLVM
Expand All @@ -137,6 +141,10 @@ else
endif
endif

ifneq (, $(findstring llvm,$(compilers)))
HAS_LLVM := 1
endif

##
# Singlepass
##
Expand All @@ -147,6 +155,10 @@ ifeq ($(IS_WINDOWS), 0)
endif
endif

ifneq (, $(findstring singlepass,$(compilers)))
HAS_SINGLEPASS := 1
endif



#####
Expand All @@ -163,12 +175,14 @@ compilers_engines :=
# The Cranelift case.
##

compilers_engines += cranelift-jit
ifeq ($(HAS_CRANELIFT, 1))
compilers_engines += cranelift-jit

ifeq ($(IS_WINDOWS), 0)
ifeq ($(IS_AMD64), 1)
ifneq ($(LIBC, musl))
compilers_engines += cranelift-native
ifeq ($(IS_WINDOWS), 0)
ifeq ($(IS_AMD64), 1)
ifneq ($(LIBC, musl))
compilers_engines += cranelift-native
endif
endif
endif
endif
Expand All @@ -177,8 +191,7 @@ endif
# The LLVM case.
##

# If `compilers` contains `llvm`.
ifneq (, $(findstring llvm,$(compilers)))
ifeq ($(HAS_LLVM), 1)
ifeq ($(IS_WINDOWS), 0)
ifeq ($(IS_AMD64), 1)
compilers_engines += llvm-jit
Expand All @@ -193,8 +206,7 @@ endif
# The Singlepass case.
##

# If `compilers` contains `singlepass`.
ifneq (, $(findstring singlepass,$(compilers)))
ifeq ($(HAS_SINGLEPASS), 1)
ifeq ($(IS_WINDOWS), 0)
if ($(IS_AMD64), 1)
compilers_engines += singlepass-jit
Expand Down

0 comments on commit 07e48b4

Please sign in to comment.