OVMS3-idf/components/cxx/CMakeLists.txt
Anton Maklakov fae64f79bb C++: prepare RTTI support
Ref. https://github.com/espressif/esp-idf/issues/1684

Also, for full RTTI support, libstdc++.a in the toolchain should be built
in both with RTTI and w/o RTTI options. Multilib with -fno-rtti
flag is used for that.

Note that this commit does not actually enable RTTI support.
The respective Kconfig option is hidden, and will be made visible when
the toolchain is updated.
2019-10-31 13:27:39 +07:00

13 lines
464 B
CMake

idf_component_register(SRCS "cxx_exception_stubs.cpp"
"cxx_guards.cpp")
target_link_libraries(${COMPONENT_LIB} PUBLIC stdc++ gcc)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy")
if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxx_fatal_exception")
endif()
if(NOT CONFIG_COMPILER_CXX_RTTI)
target_link_libraries(${COMPONENT_LIB} PUBLIC -fno-rtti)
endif()