Skip to content

Commit

Permalink
arch/x86_64:Add CXX configuration for enabling x86_64 support for C++…
Browse files Browse the repository at this point in the history
… applications.

Signed-off-by: cuiziwei <[email protected]>
  • Loading branch information
cuiziweizw authored and xiaoxiang781216 committed Oct 14, 2024
1 parent f031dc3 commit a08df48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arch/x86_64/src/cmake/Toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ add_link_options(-Wl,--no-relax)
add_compile_options(-fno-pic -mcmodel=large)
add_compile_options(-mno-red-zone)

add_compile_options(
-U_AIX
-U_WIN32
-U__APPLE__
-U__FreeBSD__
-U__NetBSD__
-U__linux__
-U__sun__
-U__unix__
-U__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)

if(CONFIG_DEBUG_LINK_MAP)
add_link_options(-Wl,--cref -Wl,-Map=nuttx.map)
endif()
Expand All @@ -109,6 +120,11 @@ if(CONFIG_CXX_STANDARD)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=${CONFIG_CXX_STANDARD}>)
endif()

if(CONFIG_LIBCXX)
add_compile_options(-D__GLIBCXX__)
add_compile_options(-D_LIBCPP_DISABLE_AVAILABILITY)
endif()

if(NOT CONFIG_LIBCXXTOOLCHAIN)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>)
endif()
Expand Down

0 comments on commit a08df48

Please sign in to comment.