From 1f07a634d1af258c9e5dc2d477dbb1a7a40a7c57 Mon Sep 17 00:00:00 2001 From: cuiziwei Date: Mon, 14 Oct 2024 16:10:53 +0800 Subject: [PATCH] libxx: Globally reference the header file of libcxxabi and remove duplication code. Signed-off-by: cuiziwei --- libs/libxx/libcxx.cmake | 5 ----- libs/libxx/libcxxabi.cmake | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libs/libxx/libcxx.cmake b/libs/libxx/libcxx.cmake index 7eaa6739584ed..69700cca31e94 100644 --- a/libs/libxx/libcxx.cmake +++ b/libs/libxx/libcxx.cmake @@ -102,10 +102,5 @@ endif() nuttx_add_system_library(libcxx) target_sources(libcxx PRIVATE ${SRCS}) target_compile_options(libcxx PRIVATE ${FLAGS}) -if(CONFIG_LIBCXXABI) - target_include_directories( - libcxx BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include) -endif() - target_include_directories(libcxx BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxx/src) diff --git a/libs/libxx/libcxxabi.cmake b/libs/libxx/libcxxabi.cmake index e6943ba60dcd8..71238a5e1d187 100644 --- a/libs/libxx/libcxxabi.cmake +++ b/libs/libxx/libcxxabi.cmake @@ -52,6 +52,11 @@ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxxabi) endif() endif() +set_property( + TARGET nuttx + APPEND + PROPERTY NUTTX_CXX_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/include/libacxxabi) + nuttx_add_system_library(libcxxabi) set(SRCS) @@ -112,7 +117,6 @@ endif() target_compile_definitions(libcxxabi PRIVATE LIBCXXABI_NON_DEMANGLING_TERMINATE) target_sources(libcxxabi PRIVATE ${TARGET_SRCS}) -target_compile_options(libcxxabi PRIVATE -frtti) target_include_directories( libcxxabi BEFORE PRIVATE ${CMAKE_CURRENT_LIST_DIR}/libcxxabi/include ${CMAKE_CURRENT_LIST_DIR}/libcxx/src)