enable C++17 support when available

This commit is contained in:
Daniel Micay 2019-03-23 19:46:54 -04:00
parent a0ee5f445b
commit c8b948e202

View File

@ -17,7 +17,7 @@ CONFIG_FREE_SLABS_QUARANTINE_RANDOM_LENGTH := 32
CONFIG_CLASS_REGION_SIZE := 137438953472 # 128GiB CONFIG_CLASS_REGION_SIZE := 137438953472 # 128GiB
define safe_flag define safe_flag
$(shell $(CC) -E $1 - </dev/null >/dev/null 2>&1 && echo $1) $(shell $(CC) -E $1 - </dev/null >/dev/null 2>&1 && echo $1 || echo $2)
endef endef
CPPFLAGS := -D_GNU_SOURCE CPPFLAGS := -D_GNU_SOURCE
@ -28,7 +28,7 @@ ifeq ($(CONFIG_NATIVE),true)
endif endif
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
CXXFLAGS := -std=c++14 $(SHARED_FLAGS) CXXFLAGS := $(call safe_flag,-std=c++17,-std=c++14) $(SHARED_FLAGS)
LDFLAGS := -Wl,--as-needed,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text LDFLAGS := -Wl,--as-needed,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text
TIDY_CHECKS := -checks=bugprone-*,-bugprone-macro-parentheses,cert-*,clang-analyzer-*,readability-*,-readability-inconsistent-declaration-parameter-name,-readability-named-parameter TIDY_CHECKS := -checks=bugprone-*,-bugprone-macro-parentheses,cert-*,clang-analyzer-*,readability-*,-readability-inconsistent-declaration-parameter-name,-readability-named-parameter