mirror of
https://github.com/nasa/trick.git
synced 2024-12-20 05:37:55 +00:00
Added case in ICG makefile to use C++17 for clang 16 as clang 16 or later builds C++ code according to the C++17 by default. (#1621)
This commit is contained in:
parent
e40fe00311
commit
9ead0a28be
@ -11,11 +11,17 @@ CLANG_PATCHLEVEL := $(shell $(LLVM_HOME)/bin/llvm-config --version | cut -f3 -d.
|
|||||||
CLANG_MINOR_GTEQ5 := $(shell [ $(CLANG_MAJOR) -gt 3 -o \( $(CLANG_MAJOR) -eq 3 -a $(CLANG_MINOR) -ge 5 \) ] && echo 1)
|
CLANG_MINOR_GTEQ5 := $(shell [ $(CLANG_MAJOR) -gt 3 -o \( $(CLANG_MAJOR) -eq 3 -a $(CLANG_MINOR) -ge 5 \) ] && echo 1)
|
||||||
|
|
||||||
CLANG_MAJOR_GTEQ10 := $(shell [ $(CLANG_MAJOR) -ge 10 ] && echo 1)
|
CLANG_MAJOR_GTEQ10 := $(shell [ $(CLANG_MAJOR) -ge 10 ] && echo 1)
|
||||||
|
# By default, Clang 16 or later builds C++ code according to the C++17 standard.
|
||||||
|
CLANG_MAJOR_GTEQ16 := $(shell [ $(CLANG_MAJOR) -ge 16 ] && echo 1)
|
||||||
|
ifeq ($(CLANG_MAJOR_GTEQ16),1)
|
||||||
|
CXXFLAGS += -std=c++17
|
||||||
|
else
|
||||||
ifeq ($(CLANG_MAJOR_GTEQ10),1)
|
ifeq ($(CLANG_MAJOR_GTEQ10),1)
|
||||||
CXXFLAGS += -std=c++14
|
CXXFLAGS += -std=c++14
|
||||||
else
|
else
|
||||||
CXXFLAGS += -std=c++11
|
CXXFLAGS += -std=c++11
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
LLVMLDFLAGS := $(shell $(LLVM_HOME)/bin/llvm-config --ldflags) $(UDUNITS_LDFLAGS)
|
LLVMLDFLAGS := $(shell $(LLVM_HOME)/bin/llvm-config --ldflags) $(UDUNITS_LDFLAGS)
|
||||||
|
|
||||||
@ -48,8 +54,12 @@ endif
|
|||||||
ifeq ($(TRICK_HOST_TYPE),Darwin)
|
ifeq ($(TRICK_HOST_TYPE),Darwin)
|
||||||
CLANGLIBS += $(shell $(LLVM_HOME)/bin/llvm-config --libs)
|
CLANGLIBS += $(shell $(LLVM_HOME)/bin/llvm-config --libs)
|
||||||
CLANGLIBS += $(filter-out -llibxml2.tbd,$(shell $(LLVM_HOME)/bin/llvm-config --system-libs))
|
CLANGLIBS += $(filter-out -llibxml2.tbd,$(shell $(LLVM_HOME)/bin/llvm-config --system-libs))
|
||||||
|
ifeq ($(CLANG_MAJOR_GTEQ16),1)
|
||||||
|
CLANGLIBS += -lc++abi -lclang-cpp
|
||||||
|
else
|
||||||
CLANGLIBS += -lc++abi
|
CLANGLIBS += -lc++abi
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(ICG)
|
all: $(ICG)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user