Skip to content

Commit

Permalink
Allow specifying clang version in makefile
Browse files Browse the repository at this point in the history
This reverts the CLANG specific checks added in
9eb2ff5, because they would break if a
specific CLANG version was specified instead of a generic one.

I hope to be able to make it so that you don't use CLANG even if your
make command has CLANG=0, but as these changes are they break things, so
I'll revert them and work on that later.
  • Loading branch information
anothersimulacrum committed Apr 26, 2020
1 parent 9eb2ff5 commit abff42a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ ifneq ($(findstring BSD,$(OS)),)
endif

# This sets CXX and so must be up here
ifeq ($(CLANG), 1)
ifdef CLANG
# Allow setting specific CLANG version
ifeq ($(CLANG), 1)
CLANGCMD = clang++
Expand All @@ -240,7 +240,7 @@ ifeq ($(CLANG), 1)
OTHERS += -stdlib=libc++
LDFLAGS += -stdlib=libc++
endif
ifdef CCACHE
ifeq ($(CCACHE), 1)
CXX = CCACHE_CPP2=1 ccache $(CROSS)$(CLANGCMD)
LD = CCACHE_CPP2=1 ccache $(CROSS)$(CLANGCMD)
else
Expand Down Expand Up @@ -306,7 +306,7 @@ ifeq ($(RELEASE), 1)
endif

ifeq ($(LTO), 1)
ifeq ($(CLANG), 1)
ifdef CLANG
# LLVM's LTO will complain if the optimization level isn't between O0 and
# O3 (inclusive)
OPTLEVEL = -O3
Expand All @@ -316,14 +316,14 @@ ifeq ($(RELEASE), 1)

ifeq ($(LTO), 1)
ifeq ($(NATIVE), osx)
ifeq ($(CLANG), 1)
ifdef CLANG
LTOFLAGS += -flto=full
endif
else
LDFLAGS += -fuse-ld=gold # This breaks in OS X because gold can only produce ELF binaries, not Mach
endif

ifeq ($(CLANG), 1)
ifdef CLANG
LTOFLAGS += -flto
else
LTOFLAGS += -flto=jobserver -flto-odr-type-merging
Expand Down Expand Up @@ -423,7 +423,7 @@ endif

# OSX
ifeq ($(NATIVE), osx)
ifeq ($(CLANG), 1)
ifdef CLANG
OSX_MIN = 10.7
else
OSX_MIN = 10.5
Expand Down

0 comments on commit abff42a

Please sign in to comment.