CMakeLists.txt 920 B

123456789101112131415161718192021222324
  1. set(sources "pthread.c"
  2. "pthread_cond_var.c"
  3. "pthread_local_storage.c"
  4. "pthread_rwlock.c")
  5. idf_component_register(SRCS ${sources}
  6. INCLUDE_DIRS include)
  7. idf_build_set_property(COMPILE_DEFINITIONS "-D_POSIX_READER_WRITER_LOCKS" APPEND)
  8. set(extra_link_flags "-u pthread_include_pthread_impl")
  9. list(APPEND extra_link_flags "-u pthread_include_pthread_cond_impl")
  10. list(APPEND extra_link_flags "-u pthread_include_pthread_local_storage_impl")
  11. list(APPEND extra_link_flags "-u pthread_include_pthread_rwlock_impl")
  12. if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP AND NOT CONFIG_FREERTOS_SMP) # See IDF-4955
  13. target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=vPortCleanUpTCB")
  14. endif()
  15. if(extra_link_flags)
  16. target_link_libraries(${COMPONENT_LIB} INTERFACE "${extra_link_flags}")
  17. endif()
  18. target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")