Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/libxx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ config LIBCXXABI_VERSION

config CXX_STANDARD
string "Language standard"
default "c++14" if TRICORE_TOOLCHAIN_TASKING
default "gnu++20" if LIBCXX
default "gnu++17" if !LIBCXX
---help---
Expand Down
35 changes: 27 additions & 8 deletions libs/libxx/libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,29 @@ if(CONFIG_LIBCXX)
endif()

file(GLOB SRCS ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/*.cpp)
file(GLOB SRCSTMP ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/experimental/*.cpp)
list(APPEND SRCS ${SRCSTMP})
file(GLOB SRCSTMP ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/filesystem/*.cpp)
list(APPEND SRCS ${SRCSTMP})
file(GLOB SRCSTMP ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/ryu/*.cpp)
list(APPEND SRCS ${SRCSTMP})

string(REGEX MATCH "[0-9]+$" CPP_STD_VER "${CONFIG_CXX_STANDARD}")
if(${CPP_STD_VER} GREATER_EQUAL 20)
file(GLOB SRCSTMP ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/experimental/*.cpp)
list(APPEND SRCS ${SRCSTMP})
file(GLOB SRCSTMP ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/filesystem/*.cpp)
list(APPEND SRCS ${SRCSTMP})
file(GLOB SRCSTMP ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/ryu/*.cpp)
list(APPEND SRCS ${SRCSTMP})
endif()

if(${CPP_STD_VER} LESS_EQUAL 14)
file(
GLOB
SRCSTMP
${CMAKE_CURRENT_LIST_DIR}/libcxx/src/any.cpp
${CMAKE_CURRENT_LIST_DIR}/libcxx/src/variant.cpp
${CMAKE_CURRENT_LIST_DIR}/libcxx/src/optional.cpp
${CMAKE_CURRENT_LIST_DIR}/libcxx/src/memory_resource.cpp
${CMAKE_CURRENT_LIST_DIR}/libcxx/src/pstl/*.cpp
${CMAKE_CURRENT_LIST_DIR}/libcxx/src/legacy_debug_handler.cpp)
list(REMOVE_ITEM SRCS ${SRCSTMP})
endif()

if(NOT CONFIG_CXX_LOCALIZATION)
file(
Expand All @@ -111,8 +128,10 @@ if(CONFIG_LIBCXX)
list(REMOVE_ITEM SRCS ${SRCSTMP})
endif()

set(FLAGS -Wno-attributes -Wno-deprecated-declarations -Wno-shadow
-Wno-sign-compare -Wno-cpp)
if(NOT CONFIG_TRICORE_TOOLCHAIN_TASKING)
set(FLAGS -Wno-attributes -Wno-deprecated-declarations -Wno-shadow
-Wno-sign-compare -Wno-cpp)
endif()

if(GCCVER GREATER_EQUAL 12)
list(APPEND FLAGS -Wno-maybe-uninitialized -Wno-alloc-size-larger-than)
Expand Down
19 changes: 16 additions & 3 deletions libs/libxx/libcxx/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,22 @@ ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
endif

CPPSRCS += $(wildcard libcxx/libcxx/src/*.cpp)
CPPSRCS += $(wildcard libcxx/libcxx/src/experimental/*.cpp)
CPPSRCS += $(wildcard libcxx/libcxx/src/filesystem/*.cpp)
CPPSRCS += $(wildcard libcxx/libcxx/src/ryu/*.cpp)
CPP_STD_VER := $(shell echo $(CONFIG_CXX_STANDARD) | sed -E 's/.*\+\+([0-9]+)$$/\1/')
ifeq ($(shell [ $(CPP_STD_VER) -ge 20 ] && echo true),true)
CPPSRCS += $(wildcard libcxx/libcxx/src/experimental/*.cpp)
CPPSRCS += $(wildcard libcxx/libcxx/src/filesystem/*.cpp)
CPPSRCS += $(wildcard libcxx/libcxx/src/ryu/*.cpp)
endif

ifeq ($(shell [ $(CPP_STD_VER) -le 14 ] && echo true),true)
EXCLUDE_CPP := libcxx/libcxx/src/any.cpp
EXCLUDE_CPP += libcxx/libcxx/src/variant.cpp
EXCLUDE_CPP += libcxx/libcxx/src/optional.cpp
EXCLUDE_CPP += libcxx/libcxx/src/memory_resource.cpp
EXCLUDE_CPP += libcxx/libcxx/src/legacy_debug_handler.cpp
EXCLUDE_CPP += $(wildcard libcxx/libcxx/src/pstl/*.cpp)
CPPSRCS := $(filter-out $(EXCLUDE_FILES), $(CPPSRCS))
endif

ifeq ($(CONFIG_CXX_LOCALIZATION),)
LOCALE_CPPSRCS := libcxx/libcxx/src/ios.cpp
Expand Down
Loading