This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new db31e56957 libxx: All cxx libraries move down one level
db31e56957 is described below
commit db31e569579c7ec9753d5fb69d07e8f997c7eae1
Author: wangmingrong1 <[email protected]>
AuthorDate: Wed Nov 6 16:30:22 2024 +0800
libxx: All cxx libraries move down one level
Since there are some patches that need to be loaded manually, the original
method is rather confusing. Now these patches that need to be loaded manually
are classified into various cxx library folders, and each dynamically
downloaded cxx library is moved down one directory to make the directory
structure clearer.
Signed-off-by: wangmingrong1 <[email protected]>
---
libs/libxx/.gitignore | 10 +-
libs/libxx/CMakeLists.txt | 14 +--
libs/libxx/Makefile | 10 +-
libs/libxx/{etl.defs => etl/Make.defs} | 32 +++---
libs/libxx/libcxx.cmake | 125 --------------------
libs/libxx/libcxx/.gitignore | 1 +
.../0001-Fix-build-error-about-__GLIBC__.patch | 0
.../{ => libcxx}/0001-libcxx-fix-ld-errors.patch | 0
.../0001-libcxx-remove-mach-time-h.patch | 0
.../0001_fix_stdatomic_h_miss_typedef.patch | 0
libs/libxx/libcxx/CMakeLists.txt | 127 +++++++++++++++++++++
libs/libxx/{libcxx.defs => libcxx/Make.defs} | 55 +++++----
libs/libxx/{ => libcxx}/mbstate_t.patch | 0
libs/libxx/libcxxabi.cmake | 123 --------------------
libs/libxx/libcxxabi/.gitignore | 1 +
...ix-build-warnings-generated-by-CMake-comp.patch | 0
.../0002-libcxxabi-fix-compilation-errors.patch | 0
libs/libxx/libcxxabi/CMakeLists.txt | 125 ++++++++++++++++++++
libs/libxx/{libcxxabi.defs => libcxxabi/Make.defs} | 31 +++--
.../CMakeLists.txt} | 52 +++++----
.../{libcxxmini.defs => libcxxmini/Make.defs} | 2 +-
libs/libxx/uClibc++.cmake | 114 ------------------
libs/libxx/uClibc++/.gitignore | 1 +
...sic_definitions-fix-GCC-specific-definiti.patch | 0
...e-overload-constructor-of-filebuf-ostream.patch | 0
libs/libxx/uClibc++/CMakeLists.txt | 116 +++++++++++++++++++
libs/libxx/{uClibc++.defs => uClibc++/Make.defs} | 34 +++---
libs/libxx/{ => uClibc++}/system_configuration.h | 0
28 files changed, 483 insertions(+), 490 deletions(-)
diff --git a/libs/libxx/.gitignore b/libs/libxx/.gitignore
index 318167c570..12d63e1fd7 100644
--- a/libs/libxx/.gitignore
+++ b/libs/libxx/.gitignore
@@ -1,8 +1,2 @@
-/uClibc++
-/libcxx
-/libcxxabi
-/libcxx-*.src.tar.xz
-/libcxxabi-*.src.tar.xz
-/etl
-/.libcxx_patch
-/.libcxxabi_patch
+*.xz
+*.bz2
diff --git a/libs/libxx/CMakeLists.txt b/libs/libxx/CMakeLists.txt
index be615f4dd9..56804a5557 100644
--- a/libs/libxx/CMakeLists.txt
+++ b/libs/libxx/CMakeLists.txt
@@ -29,16 +29,4 @@
# the configuration problem. Refer to the README.txt file in the NuttX
uClibc++
# GIT repository for more information
-if(CONFIG_HAVE_CXX)
- if(CONFIG_UCLIBCXX)
- include(uClibc++.cmake)
- elseif(CONFIG_LIBCXX)
- include(libcxx.cmake)
- elseif(CONFIG_LIBCXXMINI)
- include(libcxxmini.cmake)
- endif()
-
- if(CONFIG_LIBCXXABI)
- include(libcxxabi.cmake)
- endif()
-endif()
+nuttx_add_subdirectory()
diff --git a/libs/libxx/Makefile b/libs/libxx/Makefile
index 622b8809db..86a9f0b7f7 100644
--- a/libs/libxx/Makefile
+++ b/libs/libxx/Makefile
@@ -32,19 +32,19 @@ include $(TOPDIR)/Make.defs
# in the NuttX uClibc++ GIT repository for more information
ifeq ($(CONFIG_UCLIBCXX),y)
-include uClibc++.defs
+include uClibc++/Make.defs
else ifeq ($(CONFIG_LIBCXX),y)
-include libcxx.defs
+include libcxx/Make.defs
else ifeq ($(CONFIG_LIBCXXMINI),y)
-include libcxxmini.defs
+include libcxxmini/Make.defs
endif
ifeq ($(CONFIG_ETL),y)
-include etl.defs
+include etl/Make.defs
endif
ifeq ($(CONFIG_LIBCXXABI),y)
-include libcxxabi.defs
+include libcxxabi/Make.defs
endif
# Object Files
diff --git a/libs/libxx/etl.defs b/libs/libxx/etl/Make.defs
similarity index 62%
rename from libs/libxx/etl.defs
rename to libs/libxx/etl/Make.defs
index 823c05d4d4..c4f2230752 100644
--- a/libs/libxx/etl.defs
+++ b/libs/libxx/etl/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# libs/libxx/etl.defs
+# libs/libxx/etl/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -23,34 +23,32 @@
ETL_VERSION=20.32.1
# Download and unpack tarball if no git repo found
-ifeq ($(wildcard etl/.git),)
+ifeq ($(wildcard etl/etl/.git),)
$(ETL_VERSION).tar.gz:
- $(call
DOWNLOAD,https://github.com/ETLCPP/etl/archive/refs/tags,$(ETL_VERSION).tar.gz)
+ $(call DOWNLOAD,https://github.com/ETLCPP/etl/archive/refs/tags,$@)
-etl: $(ETL_VERSION).tar.gz
- $(Q) tar -xf $(ETL_VERSION).tar.gz
- $(Q) $(DELFILE) $(ETL_VERSION).tar.gz
- $(Q) mv etl-$(ETL_VERSION) etl
- $(Q) touch $@
+etl/etl: $(ETL_VERSION).tar.gz
+ $(Q) tar -xf $<
+ $(Q) $(DELFILE) $<
+ $(Q) mv etl-$(ETL_VERSION) $@
endif
-$(TOPDIR)/include/etl: etl
- $(Q) $(DIRLINK) $(CURDIR)/etl/include $(TOPDIR)/include/etl
+$(TOPDIR)/include/etl: etl/etl
+ $(Q) $(DIRLINK) $(CURDIR)/$</include $(TOPDIR)/include/etl
ifeq ($(CONFIG_ARCH_ARMV5M), y)
- $(Q) cp $(CURDIR)/etl/include/etl/profiles/armv5_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
+ $(Q) cp $(CURDIR)/$</include/etl/profiles/armv5_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
else ifeq ($(CONFIG_ARCH_ARMV6M), y)
- $(Q) cp $(CURDIR)/etl/include/etl/profiles/armv6_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
+ $(Q) cp $(CURDIR)/$</include/etl/profiles/armv6_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
else ifeq ($(CONFIG_ARCH_ARMV7M), y)
- $(Q) cp $(CURDIR)/etl/include/etl/profiles/armv7_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
+ $(Q) cp $(CURDIR)/$</include/etl/profiles/armv7_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
else
- $(Q) cp $(CURDIR)/etl/include/etl/profiles/gcc_generic_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
+ $(Q) cp $(CURDIR)/$</include/etl/profiles/gcc_generic_no_stl.h
$(CURDIR)/etl/include/etl/etl_profile.h
endif
context:: $(TOPDIR)/include/etl
distclean::
$(Q) $(DIRUNLINK) $(TOPDIR)/include/etl
-ifeq ($(wildcard etl/.git),)
- $(Q) $(DELFILE) $(ETL_VERSION).tar.gz
- $(call DELDIR, etl)
+ifeq ($(wildcard etl/etl/.git),)
+ $(call DELDIR, etl/etl)
endif
diff --git a/libs/libxx/libcxx.cmake b/libs/libxx/libcxx.cmake
deleted file mode 100644
index c88568f132..0000000000
--- a/libs/libxx/libcxx.cmake
+++ /dev/null
@@ -1,125 +0,0 @@
-#
##############################################################################
-# libs/libxx/libcxx.cmake
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements. See the NOTICE file distributed with this work for
-# additional information regarding copyright ownership. The ASF licenses this
-# file to you under the Apache License, Version 2.0 (the "License"); you may
not
-# use this file except in compliance with the License. You may obtain a copy
of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-#
-#
##############################################################################
-
-if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxx)
-
- set(LIBCXX_VERSION ${CONFIG_LIBCXX_VERSION})
-
- FetchContent_Declare(
- libcxx
- DOWNLOAD_NAME "libcxx-${LIBCXX_VERSION}.src.tar.xz"
- DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
- URL
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${LIBCXX_VERSION}/libcxx-${LIBCXX_VERSION}.src.tar.xz"
- SOURCE_DIR
- ${CMAKE_CURRENT_LIST_DIR}/libcxx
- BINARY_DIR
- ${CMAKE_BINARY_DIR}/libs/libc/libcxx
- CONFIGURE_COMMAND
- ""
- BUILD_COMMAND
- ""
- INSTALL_COMMAND
- ""
- TEST_COMMAND
- ""
- PATCH_COMMAND
- patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
- ${CMAKE_CURRENT_LIST_DIR}/0001_fix_stdatomic_h_miss_typedef.patch &&
patch
- -p3 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
- ${CMAKE_CURRENT_LIST_DIR}/mbstate_t.patch && patch -p1 -d
- ${CMAKE_CURRENT_LIST_DIR}/libcxx <
- ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-remove-mach-time-h.patch && patch
- -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
- ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-fix-ld-errors.patch && patch -p1 -d
- ${CMAKE_CURRENT_LIST_DIR}/libcxx <
- ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-build-error-about-__GLIBC__.patch
- DOWNLOAD_NO_PROGRESS true
- TIMEOUT 30)
-
- FetchContent_GetProperties(libcxx)
-
- if(NOT libcxx_POPULATED)
- FetchContent_Populate(libcxx)
- endif()
-
-endif()
-
-nuttx_create_symlink(${CMAKE_CURRENT_LIST_DIR}/libcxx/include
- ${CMAKE_BINARY_DIR}/include/libcxx)
-
-configure_file(${CMAKE_CURRENT_LIST_DIR}/__config_site
- ${CMAKE_BINARY_DIR}/include/libcxx/__config_site COPYONLY)
-
-set_property(
- TARGET nuttx
- APPEND
- PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include/libcxx)
-
-add_compile_definitions(_LIBCPP_BUILDING_LIBRARY)
-if(CONFIG_LIBSUPCXX_TOOLCHAIN)
- add_compile_definitions(__GLIBCXX__)
-endif()
-
-if(CONFIG_LIBSUPCXX)
- add_compile_definitions(__GLIBCXX__)
-endif()
-
-set(CMAKE_CXX_STANDARD 20)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS ON)
-
-set(SRCS)
-set(SRCSTMP)
-
-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})
-
-if(NOT CONFIG_CXX_LOCALIZATION)
- file(
- GLOB
- SRCSTMP
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/ios.cpp
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/ios.instantiations.cpp
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/iostream.cpp
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/locale.cpp
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/regex.cpp
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/strstream.cpp)
- list(REMOVE_ITEM SRCS ${SRCSTMP})
-endif()
-
-set(FLAGS -Wno-attributes -Wno-deprecated-declarations -Wno-shadow
- -Wno-sign-compare -Wno-cpp)
-
-if(GCCVER GREATER_EQUAL 12)
- list(APPEND FLAGS -Wno-maybe-uninitialized -Wno-alloc-size-larger-than)
-endif()
-
-nuttx_add_system_library(libcxx)
-target_sources(libcxx PRIVATE ${SRCS})
-target_compile_options(libcxx PRIVATE ${FLAGS})
-target_include_directories(libcxx BEFORE
- PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxx/src)
diff --git a/libs/libxx/libcxx/.gitignore b/libs/libxx/libcxx/.gitignore
new file mode 100644
index 0000000000..43d775ed05
--- /dev/null
+++ b/libs/libxx/libcxx/.gitignore
@@ -0,0 +1 @@
+/libcxx
diff --git a/libs/libxx/0001-Fix-build-error-about-__GLIBC__.patch
b/libs/libxx/libcxx/0001-Fix-build-error-about-__GLIBC__.patch
similarity index 100%
rename from libs/libxx/0001-Fix-build-error-about-__GLIBC__.patch
rename to libs/libxx/libcxx/0001-Fix-build-error-about-__GLIBC__.patch
diff --git a/libs/libxx/0001-libcxx-fix-ld-errors.patch
b/libs/libxx/libcxx/0001-libcxx-fix-ld-errors.patch
similarity index 100%
rename from libs/libxx/0001-libcxx-fix-ld-errors.patch
rename to libs/libxx/libcxx/0001-libcxx-fix-ld-errors.patch
diff --git a/libs/libxx/0001-libcxx-remove-mach-time-h.patch
b/libs/libxx/libcxx/0001-libcxx-remove-mach-time-h.patch
similarity index 100%
rename from libs/libxx/0001-libcxx-remove-mach-time-h.patch
rename to libs/libxx/libcxx/0001-libcxx-remove-mach-time-h.patch
diff --git a/libs/libxx/0001_fix_stdatomic_h_miss_typedef.patch
b/libs/libxx/libcxx/0001_fix_stdatomic_h_miss_typedef.patch
similarity index 100%
rename from libs/libxx/0001_fix_stdatomic_h_miss_typedef.patch
rename to libs/libxx/libcxx/0001_fix_stdatomic_h_miss_typedef.patch
diff --git a/libs/libxx/libcxx/CMakeLists.txt b/libs/libxx/libcxx/CMakeLists.txt
new file mode 100644
index 0000000000..be2484a39c
--- /dev/null
+++ b/libs/libxx/libcxx/CMakeLists.txt
@@ -0,0 +1,127 @@
+#
##############################################################################
+# libs/libxx/libcxx/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may
not
+# use this file except in compliance with the License. You may obtain a copy
of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+#
##############################################################################
+
+if(CONFIG_LIBCXX)
+ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxx)
+
+ set(LIBCXX_VERSION ${CONFIG_LIBCXX_VERSION})
+
+ FetchContent_Declare(
+ libcxx
+ DOWNLOAD_NAME "libcxx-${LIBCXX_VERSION}.src.tar.xz"
+ DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
+ URL
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${LIBCXX_VERSION}/libcxx-${LIBCXX_VERSION}.src.tar.xz"
+ SOURCE_DIR
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx
+ BINARY_DIR
+ ${CMAKE_BINARY_DIR}/libs/libc/libcxx
+ CONFIGURE_COMMAND
+ ""
+ BUILD_COMMAND
+ ""
+ INSTALL_COMMAND
+ ""
+ TEST_COMMAND
+ ""
+ PATCH_COMMAND
+ patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
+ ${CMAKE_CURRENT_LIST_DIR}/0001_fix_stdatomic_h_miss_typedef.patch &&
+ patch -p3 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
+ ${CMAKE_CURRENT_LIST_DIR}/mbstate_t.patch && patch -p1 -d
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx <
+ ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-remove-mach-time-h.patch && patch
+ -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
+ ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-fix-ld-errors.patch && patch -p1
+ -d ${CMAKE_CURRENT_LIST_DIR}/libcxx <
+ ${CMAKE_CURRENT_LIST_DIR}/0001-Fix-build-error-about-__GLIBC__.patch
+ DOWNLOAD_NO_PROGRESS true
+ TIMEOUT 30)
+
+ FetchContent_GetProperties(libcxx)
+
+ if(NOT libcxx_POPULATED)
+ FetchContent_Populate(libcxx)
+ endif()
+
+ endif()
+
+ nuttx_create_symlink(${CMAKE_CURRENT_LIST_DIR}/libcxx/include
+ ${CMAKE_BINARY_DIR}/include/libcxx)
+
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/../__config_site
+ ${CMAKE_BINARY_DIR}/include/libcxx/__config_site COPYONLY)
+
+ set_property(
+ TARGET nuttx
+ APPEND
+ PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include/libcxx)
+
+ add_compile_definitions(_LIBCPP_BUILDING_LIBRARY)
+ if(CONFIG_LIBSUPCXX_TOOLCHAIN)
+ add_compile_definitions(__GLIBCXX__)
+ endif()
+
+ if(CONFIG_LIBSUPCXX)
+ add_compile_definitions(__GLIBCXX__)
+ endif()
+
+ set(CMAKE_CXX_STANDARD 20)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ set(CMAKE_CXX_EXTENSIONS ON)
+
+ set(SRCS)
+ set(SRCSTMP)
+
+ 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})
+
+ if(NOT CONFIG_CXX_LOCALIZATION)
+ file(
+ GLOB
+ SRCSTMP
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/ios.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/ios.instantiations.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/iostream.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/locale.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/regex.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src/strstream.cpp)
+ list(REMOVE_ITEM SRCS ${SRCSTMP})
+ endif()
+
+ set(FLAGS -Wno-attributes -Wno-deprecated-declarations -Wno-shadow
+ -Wno-sign-compare -Wno-cpp)
+
+ if(GCCVER GREATER_EQUAL 12)
+ list(APPEND FLAGS -Wno-maybe-uninitialized -Wno-alloc-size-larger-than)
+ endif()
+
+ nuttx_add_system_library(libcxx)
+ target_sources(libcxx PRIVATE ${SRCS})
+ target_compile_options(libcxx PRIVATE ${FLAGS})
+ target_include_directories(libcxx BEFORE
+ PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxx/src)
+endif()
diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx/Make.defs
similarity index 60%
rename from libs/libxx/libcxx.defs
rename to libs/libxx/libcxx/Make.defs
index 192a6734a1..62f4fba8a7 100644
--- a/libs/libxx/libcxx.defs
+++ b/libs/libxx/libcxx/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# libs/libxx/libcxx.defs
+# libs/libxx/libcxx/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -23,37 +23,37 @@
LIBCXX_VERSION=$(patsubst "%",%,$(CONFIG_LIBCXX_VERSION))
# Download and unpack tarball if no git repo found
-ifeq ($(wildcard libcxx/.git),)
+ifeq ($(wildcard libcxx/libcxx/.git),)
libcxx-$(LIBCXX_VERSION).src.tar.xz:
- $(call
DOWNLOAD,https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION),libcxx-$(LIBCXX_VERSION).src.tar.xz)
+ $(call
DOWNLOAD,https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXX_VERSION),$@)
-libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz
- $(Q) tar -xf libcxx-$(LIBCXX_VERSION).src.tar.xz \
+libcxx/libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz
+ $(Q) tar -xf $< \
--exclude libcxx-$(LIBCXX_VERSION).src/test/std/pstl
- $(Q) mv libcxx-$(LIBCXX_VERSION).src libcxx
- $(Q) patch -p0 < 0001_fix_stdatomic_h_miss_typedef.patch
- $(Q) patch -p2 < mbstate_t.patch
- $(Q) patch -p0 < 0001-libcxx-remove-mach-time-h.patch
- $(Q) patch -p0 < 0001-libcxx-fix-ld-errors.patch
- $(Q) patch -p0 < 0001-Fix-build-error-about-__GLIBC__.patch
- $(Q) touch $@
+ $(Q) mv libcxx-$(LIBCXX_VERSION).src $@
+ $(Q) patch -p0 < libcxx/0001_fix_stdatomic_h_miss_typedef.patch -d
libcxx
+ $(Q) patch -p2 < libcxx/mbstate_t.patch -d libcxx
+ $(Q) patch -p0 < libcxx/0001-libcxx-remove-mach-time-h.patch -d libcxx
+ $(Q) patch -p0 < libcxx/0001-libcxx-fix-ld-errors.patch -d libcxx
+ $(Q) patch -p0 < libcxx/0001-Fix-build-error-about-__GLIBC__.patch -d
libcxx
+
endif
-$(TOPDIR)/include/libcxx: libcxx
- $(Q) $(DIRLINK) $(CURDIR)/libcxx/include $(TOPDIR)/include/libcxx
+$(TOPDIR)/include/libcxx: libcxx/libcxx
+ $(Q) $(DIRLINK) $(CURDIR)/$</include $(TOPDIR)/include/libcxx
$(Q) cp $(CURDIR)/__config_site $(TOPDIR)/include/libcxx/__config_site
context:: $(TOPDIR)/include/libcxx
distclean::
$(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxx
-ifeq ($(wildcard libcxx/.git),)
+ifeq ($(wildcard libcxx/libcxx/.git),)
$(Q) $(DELFILE) libcxx-$(LIBCXX_VERSION).src.tar.xz
- $(call DELDIR, libcxx)
+ $(call DELDIR, libcxx/libcxx)
endif
CXXFLAGS += ${DEFINE_PREFIX}_LIBCPP_BUILDING_LIBRARY
-CXXFLAGS += ${INCDIR_PREFIX}$(CURDIR)/libcxx/src
+CXXFLAGS += ${INCDIR_PREFIX}$(CURDIR)/libcxx/libcxx/src
ifeq ($(CONFIG_LIBSUPCXX_TOOLCHAIN),y)
CXXFLAGS += ${DEFINE_PREFIX}__GLIBCXX__
@@ -70,18 +70,17 @@ ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
CXXFLAGS += -Wno-maybe-uninitialized -Wno-alloc-size-larger-than
endif
-CPPSRCS += $(wildcard libcxx/src/*.cpp)
-CPPSRCS += $(wildcard libcxx/src/experimental/*.cpp)
-CPPSRCS += $(wildcard libcxx/src/filesystem/*.cpp)
-CPPSRCS += $(wildcard libcxx/src/ryu/*.cpp)
+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)
ifeq ($(CONFIG_CXX_LOCALIZATION),)
- LOCALE_CPPSRCS := libcxx/src/ios.cpp
- LOCALE_CPPSRCS += libcxx/src/ios.instantiations.cpp
- LOCALE_CPPSRCS += libcxx/src/iostream.cpp
- LOCALE_CPPSRCS += libcxx/src/locale.cpp
- LOCALE_CPPSRCS += libcxx/src/regex.cpp
- LOCALE_CPPSRCS += libcxx/src/strstream.cpp
+ LOCALE_CPPSRCS := libcxx/libcxx/src/ios.cpp
+ LOCALE_CPPSRCS += libcxx/libcxx/src/ios.instantiations.cpp
+ LOCALE_CPPSRCS += libcxx/libcxx/src/iostream.cpp
+ LOCALE_CPPSRCS += libcxx/libcxx/src/locale.cpp
+ LOCALE_CPPSRCS += libcxx/libcxx/src/regex.cpp
+ LOCALE_CPPSRCS += libcxx/libcxx/src/strstream.cpp
CPPSRCS := $(filter-out $(LOCALE_CPPSRCS), $(CPPSRCS))
endif
-
diff --git a/libs/libxx/mbstate_t.patch b/libs/libxx/libcxx/mbstate_t.patch
similarity index 100%
rename from libs/libxx/mbstate_t.patch
rename to libs/libxx/libcxx/mbstate_t.patch
diff --git a/libs/libxx/libcxxabi.cmake b/libs/libxx/libcxxabi.cmake
deleted file mode 100644
index 078d35df9e..0000000000
--- a/libs/libxx/libcxxabi.cmake
+++ /dev/null
@@ -1,123 +0,0 @@
-#
##############################################################################
-# libs/libxx/libcxxabi.cmake
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements. See the NOTICE file distributed with this work for
-# additional information regarding copyright ownership. The ASF licenses this
-# file to you under the Apache License, Version 2.0 (the "License"); you may
not
-# use this file except in compliance with the License. You may obtain a copy
of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-#
-#
##############################################################################
-
-if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxxabi)
-
- set(LIBCXXABI_VERSION ${CONFIG_LIBCXXABI_VERSION})
-
- FetchContent_Declare(
- libcxxabi
- DOWNLOAD_NAME "libcxxabi-${LIBCXXABI_VERSION}.src.tar.xz"
- DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
- URL
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${LIBCXXABI_VERSION}/libcxxabi-${LIBCXXABI_VERSION}.src.tar.xz"
- SOURCE_DIR
- ${CMAKE_CURRENT_LIST_DIR}/libcxxabi
- BINARY_DIR
- ${CMAKE_BINARY_DIR}/libs/libc/libcxxabi
- CONFIGURE_COMMAND
- ""
- BUILD_COMMAND
- ""
- INSTALL_COMMAND
- ""
- TEST_COMMAND
- ""
- PATCH_COMMAND ""
- DOWNLOAD_NO_PROGRESS true
- TIMEOUT 30)
-
- FetchContent_GetProperties(libcxxabi)
-
- if(NOT libcxxabi_POPULATED)
- FetchContent_Populate(libcxxabi)
- endif()
-endif()
-
-set_property(
- TARGET nuttx
- APPEND
- PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES
- ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include)
-
-nuttx_add_system_library(libcxxabi)
-
-set(SRCS)
-
-# C++ABI files
-list(
- APPEND
- SRCS
- cxa_aux_runtime.cpp
- cxa_default_handlers.cpp
- cxa_demangle.cpp
- cxa_exception_storage.cpp
- cxa_guard.cpp
- cxa_handlers.cpp
- cxa_thread_atexit.cpp
- cxa_vector.cpp
- cxa_virtual.cpp)
-
-# C++ STL files
-list(APPEND SRCS stdlib_exception.cpp stdlib_new_delete.cpp
- stdlib_stdexcept.cpp stdlib_typeinfo.cpp)
-
-# Internal files
-list(APPEND SRCS abort_message.cpp fallback_malloc.cpp private_typeinfo.cpp)
-
-if(CONFIG_CXX_EXCEPTION)
- list(APPEND SRCS cxa_exception.cpp cxa_personality.cpp)
-endif()
-
-if(CONFIG_LIBCXXABI)
- add_compile_definitions(LIBCXX_BUILDING_LIBCXXABI)
-endif()
-
-set(TARGET_SRCS)
-
-foreach(src ${SRCS})
- string(PREPEND src libcxxabi/src/)
- list(APPEND TARGET_SRCS ${src})
-endforeach()
-
-# RTTI is required for building the libcxxabi library
-target_compile_options(libcxxabi PRIVATE -frtti)
-
-if(CONFIG_SIM_UBSAN OR CONFIG_MM_UBSAN)
- target_compile_options(libcxxabi PRIVATE -fno-sanitize=vptr)
-endif()
-
-# Fix compilation error on ARM32:libcxxabi/src/cxa_personality.cpp:594:22:
-# error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope 594 |
-# results.reason = _URC_FATAL_PHASE1_ERROR;
-if(CONFIG_ARCH_ARM)
- target_compile_definitions(libcxxabi
- PRIVATE _URC_FATAL_PHASE2_ERROR=_URC_FAILURE)
- target_compile_definitions(libcxxabi
- PRIVATE _URC_FATAL_PHASE1_ERROR=_URC_FAILURE)
-endif()
-
-target_compile_definitions(libcxxabi PRIVATE
LIBCXXABI_NON_DEMANGLING_TERMINATE)
-
-target_sources(libcxxabi PRIVATE ${TARGET_SRCS})
-target_include_directories(
- libcxxabi BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include
- ${CMAKE_CURRENT_LIST_DIR}/libcxx/src)
diff --git a/libs/libxx/libcxxabi/.gitignore b/libs/libxx/libcxxabi/.gitignore
new file mode 100644
index 0000000000..8ed42390dc
--- /dev/null
+++ b/libs/libxx/libcxxabi/.gitignore
@@ -0,0 +1 @@
+/libcxxabi
diff --git
a/libs/libxx/0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch
b/libs/libxx/libcxxabi/0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch
similarity index 100%
rename from
libs/libxx/0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch
rename to
libs/libxx/libcxxabi/0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch
diff --git a/libs/libxx/0002-libcxxabi-fix-compilation-errors.patch
b/libs/libxx/libcxxabi/0002-libcxxabi-fix-compilation-errors.patch
similarity index 100%
rename from libs/libxx/0002-libcxxabi-fix-compilation-errors.patch
rename to libs/libxx/libcxxabi/0002-libcxxabi-fix-compilation-errors.patch
diff --git a/libs/libxx/libcxxabi/CMakeLists.txt
b/libs/libxx/libcxxabi/CMakeLists.txt
new file mode 100644
index 0000000000..96a6b2da2c
--- /dev/null
+++ b/libs/libxx/libcxxabi/CMakeLists.txt
@@ -0,0 +1,125 @@
+#
##############################################################################
+# libs/libxx/libcxxabi/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may
not
+# use this file except in compliance with the License. You may obtain a copy
of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+#
##############################################################################
+if(CONFIG_LIBCXXABI)
+ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxxabi)
+
+ set(LIBCXXABI_VERSION ${CONFIG_LIBCXXABI_VERSION})
+
+ FetchContent_Declare(
+ libcxxabi
+ DOWNLOAD_NAME "libcxxabi-${LIBCXXABI_VERSION}.src.tar.xz"
+ DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
+ URL
"https://github.com/llvm/llvm-project/releases/download/llvmorg-${LIBCXXABI_VERSION}/libcxxabi-${LIBCXXABI_VERSION}.src.tar.xz"
+ SOURCE_DIR
+ ${CMAKE_CURRENT_LIST_DIR}/libcxxabi
+ BINARY_DIR
+ ${CMAKE_BINARY_DIR}/libs/libc/libcxxabi
+ CONFIGURE_COMMAND
+ ""
+ BUILD_COMMAND
+ ""
+ INSTALL_COMMAND
+ ""
+ TEST_COMMAND
+ ""
+ PATCH_COMMAND ""
+ DOWNLOAD_NO_PROGRESS true
+ TIMEOUT 30)
+
+ FetchContent_GetProperties(libcxxabi)
+
+ if(NOT libcxxabi_POPULATED)
+ FetchContent_Populate(libcxxabi)
+ endif()
+ endif()
+
+ set_property(
+ TARGET nuttx
+ APPEND
+ PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include)
+
+ nuttx_add_system_library(libcxxabi)
+
+ set(SRCS)
+
+ # C++ABI files
+ list(
+ APPEND
+ SRCS
+ cxa_aux_runtime.cpp
+ cxa_default_handlers.cpp
+ cxa_demangle.cpp
+ cxa_exception_storage.cpp
+ cxa_guard.cpp
+ cxa_handlers.cpp
+ cxa_thread_atexit.cpp
+ cxa_vector.cpp
+ cxa_virtual.cpp)
+
+ # C++ STL files
+ list(APPEND SRCS stdlib_exception.cpp stdlib_new_delete.cpp
+ stdlib_stdexcept.cpp stdlib_typeinfo.cpp)
+
+ # Internal files
+ list(APPEND SRCS abort_message.cpp fallback_malloc.cpp private_typeinfo.cpp)
+
+ if(CONFIG_CXX_EXCEPTION)
+ list(APPEND SRCS cxa_exception.cpp cxa_personality.cpp)
+ endif()
+
+ if(CONFIG_LIBCXXABI)
+ add_compile_definitions(LIBCXX_BUILDING_LIBCXXABI)
+ endif()
+
+ set(TARGET_SRCS)
+
+ foreach(src ${SRCS})
+ string(PREPEND src libcxxabi/src/)
+ list(APPEND TARGET_SRCS ${src})
+ endforeach()
+
+ # RTTI is required for building the libcxxabi library
+ target_compile_options(libcxxabi PRIVATE -frtti)
+
+ if(CONFIG_SIM_UBSAN OR CONFIG_MM_UBSAN)
+ target_compile_options(libcxxabi PRIVATE -fno-sanitize=vptr)
+ endif()
+
+ # Fix compilation error on ARM32:libcxxabi/src/cxa_personality.cpp:594:22:
+ # error: '_URC_FATAL_PHASE1_ERROR' was not declared in this scope 594 |
+ # results.reason = _URC_FATAL_PHASE1_ERROR;
+ if(CONFIG_ARCH_ARM)
+ target_compile_definitions(libcxxabi
+ PRIVATE _URC_FATAL_PHASE2_ERROR=_URC_FAILURE)
+ target_compile_definitions(libcxxabi
+ PRIVATE _URC_FATAL_PHASE1_ERROR=_URC_FAILURE)
+ endif()
+
+ target_compile_definitions(libcxxabi
+ PRIVATE LIBCXXABI_NON_DEMANGLING_TERMINATE)
+
+ target_sources(libcxxabi PRIVATE ${TARGET_SRCS})
+ target_include_directories(
+ libcxxabi BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include
+ ${CMAKE_CURRENT_LIST_DIR}/libcxx/src)
+endif()
diff --git a/libs/libxx/libcxxabi.defs b/libs/libxx/libcxxabi/Make.defs
similarity index 77%
rename from libs/libxx/libcxxabi.defs
rename to libs/libxx/libcxxabi/Make.defs
index 76a028f9f4..362a7a575f 100644
--- a/libs/libxx/libcxxabi.defs
+++ b/libs/libxx/libcxxabi/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# libs/libxx/libcxxabi.defs
+# libs/libxx/libcxxabi/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -23,34 +23,33 @@
LIBCXXABI_VERSION=$(patsubst "%",%,$(CONFIG_LIBCXXABI_VERSION))
# Download and unpack tarball if no git repo found
-ifeq ($(wildcard libcxxabi/.git),)
+ifeq ($(wildcard libcxxabi/libcxxabi/.git),)
libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz:
- $(call
DOWNLOAD,https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXXABI_VERSION),libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz)
+ $(call
DOWNLOAD,https://github.com/llvm/llvm-project/releases/download/llvmorg-$(LIBCXXABI_VERSION),$@)
-libcxxabi: libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
- $(Q) tar -xf libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
- $(Q) mv libcxxabi-$(LIBCXXABI_VERSION).src libcxxabi
- $(Q) patch -p0 <
0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch
- $(Q) patch -p0 < 0002-libcxxabi-fix-compilation-errors.patch
- $(Q) touch $@
+libcxxabi/libcxxabi: libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
+ $(Q) tar -xf $<
+ $(Q) mv libcxxabi-$(LIBCXXABI_VERSION).src $@
+ $(Q) patch -p0 <
libcxxabi/0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch -d
libcxxabi
+ $(Q) patch -p0 < libcxxabi/0002-libcxxabi-fix-compilation-errors.patch
-d libcxxabi
endif
-$(TOPDIR)/include/libcxxabi: libcxxabi
- $(Q) $(DIRLINK) $(CURDIR)/libcxxabi/include $(TOPDIR)/include/libcxxabi
+$(TOPDIR)/include/libcxxabi: libcxxabi/libcxxabi
+ $(Q) $(DIRLINK) $(CURDIR)/$</include $(TOPDIR)/include/libcxxabi
$(Q) cp $(CURDIR)/__config_site
$(TOPDIR)/include/libcxxabi/__config_site
context:: $(TOPDIR)/include/libcxxabi
distclean::
$(Q) $(DIRUNLINK) $(TOPDIR)/include/libcxxabi
-ifeq ($(wildcard libcxxabi/.git),)
+ifeq ($(wildcard libcxxabi/libcxxabi/.git),)
$(Q) $(DELFILE) libcxxabi-$(LIBCXX_VERSION).src.tar.xz
- $(call DELDIR, libcxxabi)
+ $(call DELDIR, libcxxabi/libcxxabi)
endif
ifeq ($(CONFIG_LIBCXXABI), y)
CXXFLAGS += ${DEFINE_PREFIX}LIBCXX_BUILDING_LIBCXXABI
-CXXFLAGS += -I $(TOPDIR)/libs/libxx/libcxxabi/include
+CXXFLAGS += -I $(TOPDIR)/libs/libxx/libcxxabi/libcxxabi/include
# Disable dynamic type checking when enabling libcxxabi
# It results in a recursive call:
@@ -85,5 +84,5 @@ CXXFLAGS += -DLIBCXXABI_NON_DEMANGLING_TERMINATE
# RTTI is required for building the libcxxabi library
CXXFLAGS += -frtti
-DEPPATH += --dep-path libcxxabi/src
-VPATH += libcxxabi/src
+DEPPATH += --dep-path libcxxabi/libcxxabi/src
+VPATH += libcxxabi/libcxxabi/src
diff --git a/libs/libxx/libcxxmini.cmake b/libs/libxx/libcxxmini/CMakeLists.txt
similarity index 52%
rename from libs/libxx/libcxxmini.cmake
rename to libs/libxx/libcxxmini/CMakeLists.txt
index 91c9b321c0..c318c71791 100644
--- a/libs/libxx/libcxxmini.cmake
+++ b/libs/libxx/libcxxmini/CMakeLists.txt
@@ -1,5 +1,5 @@
#
##############################################################################
-# libs/libxx/libcxxmini.cmake
+# libs/libxx/libcxxmini/CMakeLists.txt
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -20,31 +20,35 @@
#
#
##############################################################################
-nuttx_add_system_library(libcxxmini)
+if(CONFIG_LIBCXXMINI)
-if(NOT CONFIG_XTENSA_TOOLCHAIN_XCC)
- add_compile_options(-Wno-missing-exception-spec)
-endif()
+ nuttx_add_system_library(libcxxmini)
+
+ if(NOT CONFIG_XTENSA_TOOLCHAIN_XCC)
+ add_compile_options(-Wno-missing-exception-spec)
+ endif()
-target_sources(
- libcxxmini
- PRIVATE libcxxmini/libxx_cxa_guard.cxx
- libcxxmini/libxx_cxapurevirtual.cxx
- libcxxmini/libxx_delete.cxx
- libcxxmini/libxx_delete_sized.cxx
- libcxxmini/libxx_deletea.cxx
- libcxxmini/libxx_deletea_sized.cxx
- libcxxmini/libxx_new.cxx
- libcxxmini/libxx_newa.cxx)
+ target_sources(
+ libcxxmini
+ PRIVATE libxx_cxa_guard.cxx
+ libxx_cxapurevirtual.cxx
+ libxx_delete.cxx
+ libxx_delete_sized.cxx
+ libxx_deletea.cxx
+ libxx_deletea_sized.cxx
+ libxx_new.cxx
+ libxx_newa.cxx)
-# Why c++14? * libcxx seems to require c++11. * The compiler defaults varies:
-# clang/macOS (from xcode): 199711L gcc/ubuntu: 201402L * There
is
-# a precedent to use c++14.
(boards/arm/stm32l4/nucleo-l476rg/scripts/Make.defs)
+ # Why c++14? * libcxx seems to require c++11. * The compiler defaults varies:
+ # clang/macOS (from xcode): 199711L gcc/ubuntu: 201402L * There
+ # is a precedent to use c++14.
+ # (boards/arm/stm32l4/nucleo-l476rg/scripts/Make.defs)
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
+ set(CMAKE_CXX_STANDARD 14)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set_property(
- TARGET nuttx
- APPEND
- PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${NUTTX_DIR}/include/cxx)
+ set_property(
+ TARGET nuttx
+ APPEND
+ PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${NUTTX_DIR}/include/cxx)
+endif()
diff --git a/libs/libxx/libcxxmini.defs b/libs/libxx/libcxxmini/Make.defs
similarity index 97%
rename from libs/libxx/libcxxmini.defs
rename to libs/libxx/libcxxmini/Make.defs
index a9394695b9..85df3f7846 100644
--- a/libs/libxx/libcxxmini.defs
+++ b/libs/libxx/libcxxmini/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# libs/libxx/libcxxmini.defs
+# libs/libxx/libcxxmini/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
diff --git a/libs/libxx/uClibc++.cmake b/libs/libxx/uClibc++.cmake
deleted file mode 100644
index e04b317133..0000000000
--- a/libs/libxx/uClibc++.cmake
+++ /dev/null
@@ -1,114 +0,0 @@
-#
##############################################################################
-# libs/libxx/uClibc++.cmake
-#
-# SPDX-License-Identifier: Apache-2.0
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements. See the NOTICE file distributed with this work for
-# additional information regarding copyright ownership. The ASF licenses this
-# file to you under the Apache License, Version 2.0 (the "License"); you may
not
-# use this file except in compliance with the License. You may obtain a copy
of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-#
-#
##############################################################################
-
-set(UCLIBCXX_DIR ${CMAKE_CURRENT_LIST_DIR}/uClibc++)
-
-if(NOT EXISTS ${UCLIBCXX_DIR})
-
- set(UCLIBCXX_VERSION 0.2.5)
-
- FetchContent_Declare(
- uClibc++
- DOWNLOAD_NAME "uClibc++-${UCLIBCXX_VERSION}.tar.bz2"
- DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
- URL
"https://git.busybox.net/uClibc++/snapshot/uClibc++-${UCLIBCXX_VERSION}.tar.bz2"
- SOURCE_DIR
- ${CMAKE_CURRENT_LIST_DIR}/uClibc++
- BINARY_DIR
- ${CMAKE_BINARY_DIR}/libs/libc/uClibc++
- CONFIGURE_COMMAND
- ""
- BUILD_COMMAND
- ""
- INSTALL_COMMAND
- ""
- TEST_COMMAND
- ""
- PATCH_COMMAND
- patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/uClibc++ <
-
${CMAKE_CURRENT_LIST_DIR}/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
- && patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/uClibc++ <
-
${CMAKE_CURRENT_LIST_DIR}/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
- DOWNLOAD_NO_PROGRESS true
- TIMEOUT 30)
-
- FetchContent_GetProperties(uClibc++)
-
- if(NOT uClibc++_POPULATED)
- FetchContent_Populate(uClibc++)
- endif()
-
-endif()
-
-nuttx_create_symlink(${CMAKE_CURRENT_LIST_DIR}/uClibc++/include
- ${CMAKE_BINARY_DIR}/include/uClibc++)
-
-configure_file(
- ${CMAKE_CURRENT_LIST_DIR}/system_configuration.h
- ${CMAKE_BINARY_DIR}/include/uClibc++/system_configuration.h COPYONLY)
-
-set_property(
- TARGET nuttx
- APPEND
- PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include/uClibc++)
-
-set(SRCS
- algorithm.cpp
- associative_base.cpp
- bitset.cpp
- char_traits.cpp
- complex.cpp
- deque.cpp
- exception.cpp
- fstream.cpp
- func_exception.cpp
- iomanip.cpp
- ios.cpp
- iostream.cpp
- istream.cpp
- iterator.cpp
- limits.cpp
- list.cpp
- locale.cpp
- map.cpp
- numeric.cpp
- ostream.cpp
- queue.cpp
- set.cpp
- sstream.cpp
- stack.cpp
- stdexcept.cpp
- streambuf.cpp
- string.cpp
- utility.cpp
- valarray.cpp
- vector.cpp)
-
-set(TARGET_SRCS)
-
-foreach(src ${SRCS})
- string(PREPEND src uClibc++/src/)
- list(APPEND TARGET_SRCS ${src})
-endforeach()
-
-nuttx_add_system_library(uClibc++)
-target_sources(uClibc++ PRIVATE ${TARGET_SRCS})
diff --git a/libs/libxx/uClibc++/.gitignore b/libs/libxx/uClibc++/.gitignore
new file mode 100644
index 0000000000..23cd7b942b
--- /dev/null
+++ b/libs/libxx/uClibc++/.gitignore
@@ -0,0 +1 @@
+/uClibc++
diff --git
a/libs/libxx/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
b/libs/libxx/uClibc++/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
similarity index 100%
rename from
libs/libxx/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
rename to
libs/libxx/uClibc++/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
diff --git
a/libs/libxx/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
b/libs/libxx/uClibc++/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
similarity index 100%
rename from
libs/libxx/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
rename to
libs/libxx/uClibc++/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
diff --git a/libs/libxx/uClibc++/CMakeLists.txt
b/libs/libxx/uClibc++/CMakeLists.txt
new file mode 100644
index 0000000000..0eb32029ff
--- /dev/null
+++ b/libs/libxx/uClibc++/CMakeLists.txt
@@ -0,0 +1,116 @@
+#
##############################################################################
+# libs/libxx/uClibc++/CMakeLists.txt
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
+# license agreements. See the NOTICE file distributed with this work for
+# additional information regarding copyright ownership. The ASF licenses this
+# file to you under the Apache License, Version 2.0 (the "License"); you may
not
+# use this file except in compliance with the License. You may obtain a copy
of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+#
+#
##############################################################################
+
+if(CONFIG_UCLIBCXX)
+ set(UCLIBCXX_DIR ${CMAKE_CURRENT_LIST_DIR}/uClibc++)
+
+ if(NOT EXISTS ${UCLIBCXX_DIR})
+
+ set(UCLIBCXX_VERSION 0.2.5)
+
+ FetchContent_Declare(
+ uClibc++
+ DOWNLOAD_NAME "uClibc++-${UCLIBCXX_VERSION}.tar.bz2"
+ DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
+ URL
"https://git.busybox.net/uClibc++/snapshot/uClibc++-${UCLIBCXX_VERSION}.tar.bz2"
+ SOURCE_DIR
+ ${CMAKE_CURRENT_LIST_DIR}/uClibc++
+ BINARY_DIR
+ ${CMAKE_BINARY_DIR}/libs/libc/uClibc++
+ CONFIGURE_COMMAND
+ ""
+ BUILD_COMMAND
+ ""
+ INSTALL_COMMAND
+ ""
+ TEST_COMMAND
+ ""
+ PATCH_COMMAND
+ patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/uClibc++ <
+
${CMAKE_CURRENT_LIST_DIR}/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
+ && patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/uClibc++ <
+
${CMAKE_CURRENT_LIST_DIR}/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
+ DOWNLOAD_NO_PROGRESS true
+ TIMEOUT 30)
+
+ FetchContent_GetProperties(uClibc++)
+
+ if(NOT uClibc++_POPULATED)
+ FetchContent_Populate(uClibc++)
+ endif()
+
+ endif()
+
+ nuttx_create_symlink(${CMAKE_CURRENT_LIST_DIR}/uClibc++/include
+ ${CMAKE_BINARY_DIR}/include/uClibc++)
+
+ configure_file(
+ ${CMAKE_CURRENT_LIST_DIR}/system_configuration.h
+ ${CMAKE_BINARY_DIR}/include/uClibc++/system_configuration.h COPYONLY)
+
+ set_property(
+ TARGET nuttx
+ APPEND
+ PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES
${CMAKE_BINARY_DIR}/include/uClibc++)
+
+ set(SRCS
+ algorithm.cpp
+ associative_base.cpp
+ bitset.cpp
+ char_traits.cpp
+ complex.cpp
+ deque.cpp
+ exception.cpp
+ fstream.cpp
+ func_exception.cpp
+ iomanip.cpp
+ ios.cpp
+ iostream.cpp
+ istream.cpp
+ iterator.cpp
+ limits.cpp
+ list.cpp
+ locale.cpp
+ map.cpp
+ numeric.cpp
+ ostream.cpp
+ queue.cpp
+ set.cpp
+ sstream.cpp
+ stack.cpp
+ stdexcept.cpp
+ streambuf.cpp
+ string.cpp
+ utility.cpp
+ valarray.cpp
+ vector.cpp)
+
+ set(TARGET_SRCS)
+
+ foreach(src ${SRCS})
+ string(PREPEND src uClibc++/src/)
+ list(APPEND TARGET_SRCS ${src})
+ endforeach()
+
+ nuttx_add_system_library(uClibc++)
+ target_sources(uClibc++ PRIVATE ${TARGET_SRCS})
+endif()
diff --git a/libs/libxx/uClibc++.defs b/libs/libxx/uClibc++/Make.defs
similarity index 65%
rename from libs/libxx/uClibc++.defs
rename to libs/libxx/uClibc++/Make.defs
index 00d92b9741..27b767c030 100644
--- a/libs/libxx/uClibc++.defs
+++ b/libs/libxx/uClibc++/Make.defs
@@ -1,5 +1,5 @@
############################################################################
-# libs/libxx/uClibc++.defs
+# libs/libxx/uClibc++/Make.defs
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -23,27 +23,29 @@
UCLIBCXX_VERSION=0.2.5
# Download and unpack tarball if no git repo found
-ifeq ($(wildcard uClibc++/.git),)
-uClibc++:
- curl -O -L
https://git.busybox.net/uClibc++/snapshot/uClibc++-$(UCLIBCXX_VERSION).tar.bz2
- $(Q) tar -xf uClibc++-$(UCLIBCXX_VERSION).tar.bz2
- $(Q) $(DELFILE) uClibc++-$(UCLIBCXX_VERSION).tar.bz2
- $(Q) mv uClibc++-$(UCLIBCXX_VERSION) uClibc++
- $(Q) patch -p0 <
0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch
- $(Q) patch -p0 <
0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch
+ifeq ($(wildcard uClibc++/uClibc++/.git),)
+uClibc++-$(UCLIBCXX_VERSION).tar.bz2:
+ curl -O -L https://git.busybox.net/uClibc++/snapshot/$@
+
+uClibc++/uClibc++: uClibc++-$(UCLIBCXX_VERSION).tar.bz2
+ $(Q) tar -xf $<
+ $(Q) $(DELFILE) $<
+ $(Q) mv uClibc++-$(UCLIBCXX_VERSION) $@
+ $(Q) patch -p0 <
uClibc++/0001-uClibcxx-basic_definitions-fix-GCC-specific-definiti.patch -d
uClibc++
+ $(Q) patch -p0 <
uClibc++/0001-uclibxx-use-overload-constructor-of-filebuf-ostream.patch -d
uClibc++
endif
-$(TOPDIR)/include/uClibc++: uClibc++
- $(Q) $(DIRLINK) $(CURDIR)/uClibc++/include $(TOPDIR)/include/uClibc++
- $(Q) $(COPYFILE) $(CURDIR)/system_configuration.h
$(TOPDIR)/include/uClibc++
+$(TOPDIR)/include/uClibc++: uClibc++/uClibc++
+ $(Q) $(DIRLINK) $(CURDIR)/uClibc++/uClibc++/include
$(TOPDIR)/include/uClibc++
+ $(Q) $(COPYFILE) $(CURDIR)/uClibc++/system_configuration.h
$(TOPDIR)/include/uClibc++
context:: $(TOPDIR)/include/uClibc++
distclean::
$(Q) $(DELFILE) $(TOPDIR)/include/uClibc++/system_configuration.h
$(Q) $(DIRUNLINK) $(TOPDIR)/include/uClibc++
-ifeq ($(wildcard uClibc++/.git),)
- $(call DELDIR, uClibc++)
+ifeq ($(wildcard uClibc++/uClibc++/.git),)
+ $(call DELDIR, uClibc++/uClibc++)
endif
CPPSRCS += algorithm.cpp associative_base.cpp bitset.cpp char_traits.cpp
@@ -54,5 +56,5 @@ CPPSRCS += ostream.cpp queue.cpp set.cpp sstream.cpp
stack.cpp stdexcept.cpp
CPPSRCS += streambuf.cpp string.cpp utility.cpp valarray.cpp
CPPSRCS += vector.cpp
-DEPPATH += --dep-path uClibc++/src
-VPATH += uClibc++/src
+DEPPATH += --dep-path uClibc++/uClibc++/src
+VPATH += uClibc++/uClibc++/src
diff --git a/libs/libxx/system_configuration.h
b/libs/libxx/uClibc++/system_configuration.h
similarity index 100%
rename from libs/libxx/system_configuration.h
rename to libs/libxx/uClibc++/system_configuration.h