Skip to content

Commit

Permalink
Merge pull request #38430 from CleverRaven/makefile-use_libcxx
Browse files Browse the repository at this point in the history
Allow using different standard library through USE_LIBCXX
  • Loading branch information
ZhilkinSerg authored Feb 28, 2020
2 parents d9dbfbe + 9c4749b commit 23fbf18
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ ifneq ($(findstring BSD,$(OS)),)
BSD = 1
endif

# Which standard library to use (e.g. libstdc++ or libc++)
ifdef USE_LIBCXX
OTHERS += -stdlib=$(USE_LIBCXX)
LDFLAGS += -stdlib=$(USE_LIBCXX)
endif

# This sets CXX and so must be up here
ifdef CLANG
# Allow setting specific CLANG version
Expand All @@ -227,13 +233,6 @@ ifdef CLANG
else
CLANGCMD = $(CLANG)
endif
ifeq ($(NATIVE), osx)
USE_LIBCXX = 1
endif
ifdef USE_LIBCXX
OTHERS += -stdlib=libc++
LDFLAGS += -stdlib=libc++
endif
ifdef CCACHE
CXX = CCACHE_CPP2=1 ccache $(CROSS)$(CLANGCMD)
LD = CCACHE_CPP2=1 ccache $(CROSS)$(CLANGCMD)
Expand Down

0 comments on commit 23fbf18

Please sign in to comment.