mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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:
committed by
Petro Karashchenko
parent
6b4da4ad6e
commit
f64da13e9b
@@ -234,6 +234,10 @@ endif
|
|||||||
ARCHCFLAGS += -Wstrict-prototypes
|
ARCHCFLAGS += -Wstrict-prototypes
|
||||||
ARCHCXXFLAGS += -nostdinc++
|
ARCHCXXFLAGS += -nostdinc++
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -80,6 +80,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Werror
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef -Werror
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -104,6 +104,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -265,6 +265,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -77,6 +77,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -73,6 +73,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -82,6 +82,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -85,6 +85,10 @@ ARCHCXXFLAGS += -fno-common -nostdinc++
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
ifneq ($(CONFIG_CXX_EXCEPTION),y)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ ARCHCXXFLAGS += -ffunction-sections -fdata-sections
|
|||||||
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
ARCHCFLAGS += -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||||
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
ARCHCXXFLAGS += -Wall -Wshadow -Wundef
|
||||||
|
|
||||||
|
ifneq ($(CONFIG_CXX_STANDARD),)
|
||||||
|
ARCHCXXFLAGS += -std=$(CONFIG_CXX_STANDARD)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_CXX_EXCEPTION),)
|
ifeq ($(CONFIG_CXX_EXCEPTION),)
|
||||||
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
ARCHCXXFLAGS += -fno-exceptions -fcheck-new
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -85,6 +85,12 @@ endchoice
|
|||||||
|
|
||||||
endif
|
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
|
config CXX_EXCEPTION
|
||||||
bool "Enable Exception Support"
|
bool "Enable Exception Support"
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ ifeq ($(wildcard libcxx/.git),)
|
|||||||
$(call DELDIR, libcxx)
|
$(call DELDIR, libcxx)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CXXFLAGS += -std=c++17
|
|
||||||
CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY
|
CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY
|
||||||
|
|
||||||
ifeq ($(CONFIG_LIBSUPCXX), y)
|
ifeq ($(CONFIG_LIBSUPCXX), y)
|
||||||
|
|||||||
Reference in New Issue
Block a user