Skip to content

Commit

Permalink
cmake(bugfix):fix libcxxabi layout build error
Browse files Browse the repository at this point in the history
Signed-off-by: haopengxiang <[email protected]>
  • Loading branch information
pengxianghao21 authored and xiaoxiang781216 committed Jan 9, 2025
1 parent afc4585 commit aa4090e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions libs/libxx/libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ if(CONFIG_LIBCXX)
add_compile_definitions(__GLIBCXX__)
endif()

if(CONFIG_LIBCXXABI)
add_compile_definitions(LIBCXX_BUILDING_LIBCXXABI)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
Expand Down
11 changes: 9 additions & 2 deletions libs/libxx/libcxxabi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,14 @@ if(CONFIG_LIBCXXABI)
cxa_thread_atexit.cpp
cxa_vector.cpp
cxa_virtual.cpp)
add_compile_definitions(_LIBCPP_BUILDING_LIBRARY)
if(CONFIG_LIBSUPCXX_TOOLCHAIN)
add_compile_definitions(__GLIBCXX__)
endif()

if(CONFIG_LIBSUPCXX)
add_compile_definitions(__GLIBCXX__)
endif()
# C++ STL files
list(APPEND SRCS stdlib_exception.cpp stdlib_new_delete.cpp
stdlib_stdexcept.cpp stdlib_typeinfo.cpp)
Expand Down Expand Up @@ -121,6 +128,6 @@ if(CONFIG_LIBCXXABI)

target_sources(libcxxabi PRIVATE ${TARGET_SRCS})
target_include_directories(
libcxxabi BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include
${CMAKE_CURRENT_LIST_DIR}/libcxx/src)
libcxxabi BEFORE PRIVATE ${NUTTX_DIR}/libs/libxx/libcxx/libcxx/src
${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include)
endif()

0 comments on commit aa4090e

Please sign in to comment.