forked from nuttx/nuttx-update
libxx: Add CXX_STANDARD to select -std=c++??
and default to "c++17" Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
6b4da4ad6e
commit
f64da13e9b
14 changed files with 54 additions and 1 deletions
|
@ -234,6 +234,10 @@ endif
|
|||
ARCHCFLAGS += -Wstrict-prototypes
|
||||
ARCHCXXFLAGS += -nostdinc++
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -80,6 +80,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Werror
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -104,6 +104,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -51,6 +51,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -265,6 +265,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -77,6 +77,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -60,6 +60,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -73,6 +73,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -82,6 +82,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -85,6 +85,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -85,6 +85,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -106,6 +106,10 @@ ARCHCXXFLAGS += -ffunction-sections -fdata-sections
|
|||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||
|
||||
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CXX_EXCEPTION),)
|
||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||
endif
|
||||
|
|
|
@ -85,6 +85,12 @@ endchoice
|
|||
|
||||
endif
|
||||
|
||||
config CXX_STANDARD
|
||||
string "Language standard"
|
||||
default "c++17"
|
||||
---help---
|
||||
Possible values: c++98, c++11, c++14, c++17 and c++20
|
||||
|
||||
config CXX_EXCEPTION
|
||||
bool "Enable Exception Support"
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ ifeq ($(wildcard libcxx/.git),)
|
|||
$(call DELDIR, libcxx)
|
||||
endif
|
||||
|
||||
CXXFLAGS += -std=c++17
|
||||
CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY
|
||||
|
||||
ifeq ($(CONFIG_LIBSUPCXX), y)
|
||||
|
|
Loading…
Reference in a new issue