CMakeLists.txt 779 B

1234567891011121314151617
  1. idf_component_register(SRCS "cxx_exception_stubs.cpp"
  2. "cxx_guards.cpp"
  3. # Make sure that pthread is in component list
  4. PRIV_REQUIRES pthread)
  5. target_link_libraries(${COMPONENT_LIB} PUBLIC stdc++ gcc)
  6. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxa_guard_dummy")
  7. # Force pthread to also appear later than stdc++ in link line
  8. add_library(stdcpp_pthread INTERFACE)
  9. idf_component_get_property(pthread pthread COMPONENT_LIB)
  10. target_link_libraries(stdcpp_pthread INTERFACE stdc++ $<TARGET_FILE:${pthread}>)
  11. target_link_libraries(${COMPONENT_LIB} PUBLIC stdcpp_pthread)
  12. if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS)
  13. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxx_fatal_exception")
  14. endif()