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:
Xiang Xiao 2023-01-16 02:17:19 +08:00 committed by Petro Karashchenko
parent 6b4da4ad6e
commit f64da13e9b
14 changed files with 54 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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)