xiaoxiang781216 commented on a change in pull request #2111: URL: https://github.com/apache/incubator-nuttx/pull/2111#discussion_r524208334
########## File path: boards/sim/sim/sim/scripts/Make.defs ########## @@ -100,6 +100,24 @@ CXXFLAGS := $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ +ifeq ($(CONFIG_LIBCXX),y) + CXXFLAGS += -std=c++14 -D_LIBCPP_STD_VER=14 + + ifeq ($(CONFIG_HOST_MACOS),y) + # macOS uses libc++abi + CXXFLAGS += -DLIBCXX_BUILDING_LIBCXXABI + else + # Linux C++ ABI seems vary. + # Probably __GLIBCXX__ is the best bet. + # XXX what to do for windows? + CXXFLAGS += -D__GLIBCXX__ + endif + + ifneq ($(CONFIG_CXX_EXCEPTION),y) + CXXFLAGS += -D_LIBCPP_NO_EXCEPTIONS Review comment: don't need libc++ will detect the setting automatically: ``` #if !__has_feature(cxx_exceptions) # define _LIBCPP_NO_EXCEPTIONS #endif ``` ########## File path: boards/sim/sim/sim/scripts/Make.defs ########## @@ -100,6 +100,24 @@ CXXFLAGS := $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ +ifeq ($(CONFIG_LIBCXX),y) + CXXFLAGS += -std=c++14 -D_LIBCPP_STD_VER=14 Review comment: why add this or not c++17? libc++ can work with c++11 too. ########## File path: boards/sim/sim/sim/scripts/Make.defs ########## @@ -100,6 +100,24 @@ CXXFLAGS := $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ +ifeq ($(CONFIG_LIBCXX),y) + CXXFLAGS += -std=c++14 -D_LIBCPP_STD_VER=14 + + ifeq ($(CONFIG_HOST_MACOS),y) + # macOS uses libc++abi + CXXFLAGS += -DLIBCXX_BUILDING_LIBCXXABI Review comment: libc++ specific config should go to https://github.com/apache/incubator-nuttx/blob/master/libs/libxx/libcxx.defs? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org