CMakeLists.txt 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. cmake_minimum_required(VERSION 3.5)
  2. set(TOP "../../..")
  3. get_filename_component(TOP "${TOP}" REALPATH)
  4. if (EXISTS ${TOP}/lib/lwip/src)
  5. include(${TOP}/hw/bsp/family_support.cmake)
  6. # gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
  7. family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
  8. project(${PROJECT})
  9. # Checks this example is valid for the family and initializes the project
  10. family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
  11. add_executable(${PROJECT})
  12. # Example source
  13. target_sources(${PROJECT} PUBLIC
  14. ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
  15. ${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
  16. )
  17. # Example include
  18. target_include_directories(${PROJECT} PUBLIC
  19. ${CMAKE_CURRENT_SOURCE_DIR}/src
  20. ${TOP}/lib/lwip/src/include
  21. ${TOP}/lib/lwip/src/include/ipv4
  22. ${TOP}/lib/lwip/src/include/lwip/apps
  23. ${TOP}/lib/networking
  24. )
  25. target_sources(${PROJECT} PUBLIC
  26. ${TOP}/lib/lwip/src/core/altcp.c
  27. ${TOP}/lib/lwip/src/core/altcp_alloc.c
  28. ${TOP}/lib/lwip/src/core/altcp_tcp.c
  29. ${TOP}/lib/lwip/src/core/def.c
  30. ${TOP}/lib/lwip/src/core/dns.c
  31. ${TOP}/lib/lwip/src/core/inet_chksum.c
  32. ${TOP}/lib/lwip/src/core/init.c
  33. ${TOP}/lib/lwip/src/core/ip.c
  34. ${TOP}/lib/lwip/src/core/mem.c
  35. ${TOP}/lib/lwip/src/core/memp.c
  36. ${TOP}/lib/lwip/src/core/netif.c
  37. ${TOP}/lib/lwip/src/core/pbuf.c
  38. ${TOP}/lib/lwip/src/core/raw.c
  39. ${TOP}/lib/lwip/src/core/stats.c
  40. ${TOP}/lib/lwip/src/core/sys.c
  41. ${TOP}/lib/lwip/src/core/tcp.c
  42. ${TOP}/lib/lwip/src/core/tcp_in.c
  43. ${TOP}/lib/lwip/src/core/tcp_out.c
  44. ${TOP}/lib/lwip/src/core/timeouts.c
  45. ${TOP}/lib/lwip/src/core/udp.c
  46. ${TOP}/lib/lwip/src/core/ipv4/autoip.c
  47. ${TOP}/lib/lwip/src/core/ipv4/dhcp.c
  48. ${TOP}/lib/lwip/src/core/ipv4/etharp.c
  49. ${TOP}/lib/lwip/src/core/ipv4/icmp.c
  50. ${TOP}/lib/lwip/src/core/ipv4/igmp.c
  51. ${TOP}/lib/lwip/src/core/ipv4/ip4.c
  52. ${TOP}/lib/lwip/src/core/ipv4/ip4_addr.c
  53. ${TOP}/lib/lwip/src/core/ipv4/ip4_frag.c
  54. ${TOP}/lib/lwip/src/netif/ethernet.c
  55. ${TOP}/lib/lwip/src/netif/slipif.c
  56. ${TOP}/lib/lwip/src/apps/http/httpd.c
  57. ${TOP}/lib/lwip/src/apps/http/fs.c
  58. ${TOP}/lib/networking/dhserver.c
  59. ${TOP}/lib/networking/dnserver.c
  60. ${TOP}/lib/networking/rndis_reports.c
  61. )
  62. # due to warnings from other net source, we need to prevent error from some of the warnings options
  63. target_compile_options(${PROJECT} PUBLIC
  64. -Wno-error=null-dereference
  65. -Wno-error=conversion
  66. -Wno-error=sign-conversion
  67. -Wno-error=sign-compare
  68. )
  69. # Configure compilation flags and libraries for the example... see the corresponding function
  70. # in hw/bsp/FAMILY/family.cmake for details.
  71. family_configure_device_example(${PROJECT})
  72. endif()