CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. set(priv_req mbedtls)
  2. set(priv_inc_dir "src/util")
  3. set(requires http_parser esp_event)
  4. if(NOT ${IDF_TARGET} STREQUAL "linux")
  5. list(APPEND priv_req lwip esp_timer)
  6. list(APPEND priv_inc_dir "src/port/esp32")
  7. else()
  8. list(APPEND priv_inc_dir "src/port/linux")
  9. list(APPEND priv_req pthread)
  10. endif()
  11. idf_component_register(SRCS "src/httpd_main.c"
  12. "src/httpd_parse.c"
  13. "src/httpd_sess.c"
  14. "src/httpd_txrx.c"
  15. "src/httpd_uri.c"
  16. "src/httpd_ws.c"
  17. "src/util/ctrl_sock.c"
  18. INCLUDE_DIRS "include"
  19. PRIV_INCLUDE_DIRS ${priv_inc_dir}
  20. REQUIRES ${requires}
  21. PRIV_REQUIRES ${priv_req})
  22. if(${IDF_TARGET} STREQUAL "linux")
  23. find_library(LIB_BSD bsd)
  24. if(LIB_BSD)
  25. target_link_libraries(${COMPONENT_LIB} PRIVATE ${LIB_BSD})
  26. elseif(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
  27. message(WARNING "Missing LIBBSD library. Install libbsd-dev package and/or check linker directories.")
  28. endif()
  29. endif()