CMakeLists.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. idf_build_get_property(target IDF_TARGET)
  2. set(priv_include_dirs "private_include")
  3. set(priv_requires "")
  4. set(requires "log" "esp_common" "freertos")
  5. set(srcs "default_event_loop.c"
  6. "esp_event.c"
  7. "esp_event_private.c")
  8. if(${target} STREQUAL "linux")
  9. list(APPEND requires "linux")
  10. # Temporary fix until esp_system is available for linux, too
  11. list(APPEND priv_include_dirs "$ENV{IDF_PATH}/tools/mocks/esp_system/include")
  12. else()
  13. list(APPEND requires "esp_netif")
  14. list(APPEND srcs "event_loop_legacy.c" "event_send.c")
  15. if(${target} STREQUAL "esp32")
  16. list(APPEND priv_requires esp_eth esp_timer)
  17. else()
  18. list(APPEND priv_requires esp_timer)
  19. endif()
  20. endif()
  21. idf_component_register(SRCS ${srcs}
  22. INCLUDE_DIRS "include"
  23. PRIV_INCLUDE_DIRS ${priv_include_dirs}
  24. REQUIRES ${requires}
  25. PRIV_REQUIRES ${priv_requires}
  26. LDFRAGMENTS linker.lf)
  27. if(CONFIG_ESP_EVENT_LOOP_PROFILING)
  28. # uses C11 atomic feature
  29. set_source_files_properties(esp_event.c PROPERTIES COMPILE_FLAGS -std=gnu11)
  30. endif()