CMakeLists.txt 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. # Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. # All rights reserved.
  3. #
  4. # This software is supplied "AS IS" without any warranties.
  5. # RDA assumes no responsibility or liability for the use of the software,
  6. # conveys no license or title under any patent, copyright, or mask work
  7. # right to the product. RDA reserves the right to make changes in the
  8. # software without notification. RDA also make no representation or
  9. # warranty that such application will be suitable for the specified use
  10. # without further testing or modification.
  11. set(target lwip)
  12. add_app_libraries($<TARGET_FILE:${target}>)
  13. add_library(${target} STATIC)
  14. set_target_properties(${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${out_lib_dir})
  15. target_compile_definitions(${target} PRIVATE OSI_LOG_TAG=LOG_TAG_NET)
  16. target_include_directories(${target} PUBLIC src/include/compat/posix src/include include)
  17. target_include_targets(${target} PUBLIC cfw)
  18. target_include_targets(${target} PRIVATE kernel driver calclib net atr)
  19. if (CONFIG_QUEC_PROJECT_FEATURE_SSL)
  20. target_include_targets(${target} PRIVATE mbedtls)
  21. endif()
  22. target_include_directories(${target} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
  23. target_include_directories(${target} PRIVATE src/include)
  24. target_include_directories(${target} PRIVATE src/include/lwip)
  25. target_include_targets_if(CONFIG_MBEDTLS_LIB_SUPPORT THEN ${target} PRIVATE mbedtls)
  26. set(LWIPDIR src)
  27. set(COREFILES ${LWIPDIR}/core/init.c
  28. ${LWIPDIR}/core/def.c
  29. ${LWIPDIR}/core/dns.c
  30. ${LWIPDIR}/core/inet_chksum.c
  31. ${LWIPDIR}/core/ip.c
  32. ${LWIPDIR}/core/mem.c
  33. ${LWIPDIR}/core/memp.c
  34. ${LWIPDIR}/core/netif.c
  35. ${LWIPDIR}/core/pbuf.c
  36. ${LWIPDIR}/core/raw.c
  37. ${LWIPDIR}/core/stats.c
  38. ${LWIPDIR}/core/sys.c
  39. ${LWIPDIR}/core/altcp.c
  40. ${LWIPDIR}/core/altcp_alloc.c
  41. ${LWIPDIR}/core/altcp_tcp.c
  42. ${LWIPDIR}/core/tcp.c
  43. ${LWIPDIR}/core/tcp_in.c
  44. ${LWIPDIR}/core/tcp_out.c
  45. ${LWIPDIR}/core/timeouts.c
  46. ${LWIPDIR}/core/udp.c
  47. )
  48. set(CORE4FILES ${LWIPDIR}/core/ipv4/autoip.c
  49. ${LWIPDIR}/core/ipv4/dhcp.c
  50. ${LWIPDIR}/core/ipv4/etharp.c
  51. ${LWIPDIR}/core/ipv4/icmp.c
  52. ${LWIPDIR}/core/ipv4/igmp.c
  53. ${LWIPDIR}/core/ipv4/ip4_frag.c
  54. ${LWIPDIR}/core/ipv4/ip4.c
  55. ${LWIPDIR}/core/ipv4/ip4_addr.c
  56. ${LWIPDIR}/core/ipv4/acd.c
  57. ${LWIPDIR}/core/ipv4/ip4_nat.c #展锐在46.5基线上删除了这个文件,改为闭源库发布,改文件我们改动很多不允许直接被替换
  58. )
  59. set(CORE6FILES ${LWIPDIR}/core/ipv6/dhcp6.c
  60. ${LWIPDIR}/core/ipv6/ethip6.c
  61. ${LWIPDIR}/core/ipv6/icmp6.c
  62. ${LWIPDIR}/core/ipv6/inet6.c
  63. ${LWIPDIR}/core/ipv6/ip6.c
  64. ${LWIPDIR}/core/ipv6/ip6_addr.c
  65. ${LWIPDIR}/core/ipv6/ip6_frag.c
  66. ${LWIPDIR}/core/ipv6/mld6.c
  67. ${LWIPDIR}/core/ipv6/nd6.c
  68. )
  69. # APIFILES: The files which implement the sequential and socket APIs.
  70. set(APIFILES ${LWIPDIR}/api/api_lib.c
  71. ${LWIPDIR}/api/api_msg.c
  72. ${LWIPDIR}/api/err.c
  73. ${LWIPDIR}/api/if_api.c
  74. ${LWIPDIR}/api/netbuf.c
  75. ${LWIPDIR}/api/netdb.c
  76. ${LWIPDIR}/api/netifapi.c
  77. ${LWIPDIR}/api/sockets.c
  78. ${LWIPDIR}/api/tcpip.c
  79. )
  80. # NETIFFILES: Files implementing various generic network interface functions
  81. set(NETIFFILES ${LWIPDIR}/netif/ethernet.c
  82. ${LWIPDIR}/netif/bridgeif.c
  83. ${LWIPDIR}/netif/bridgeif_fdb.c
  84. ${LWIPDIR}/netif/slipif.c
  85. )
  86. # SIXLOWPAN: 6LoWPAN
  87. set(SIXLOWPAN ${LWIPDIR}/netif/lowpan6_common.c
  88. ${LWIPDIR}/netif/lowpan6.c
  89. ${LWIPDIR}/netif/lowpan6_ble.c
  90. ${LWIPDIR}/netif/zepif.c
  91. )
  92. # PPPFILES: PPP
  93. set(PPPFILES ${LWIPDIR}/netif/ppp/auth.c
  94. ${LWIPDIR}/netif/ppp/ccp.c
  95. ${LWIPDIR}/netif/ppp/chap-md5.c
  96. ${LWIPDIR}/netif/ppp/chap_ms.c
  97. ${LWIPDIR}/netif/ppp/chap-new.c
  98. ${LWIPDIR}/netif/ppp/demand.c
  99. ${LWIPDIR}/netif/ppp/eap.c
  100. ${LWIPDIR}/netif/ppp/ecp.c
  101. ${LWIPDIR}/netif/ppp/eui64.c
  102. ${LWIPDIR}/netif/ppp/fsm.c
  103. ${LWIPDIR}/netif/ppp/ipcp.c
  104. ${LWIPDIR}/netif/ppp/ipv6cp.c
  105. ${LWIPDIR}/netif/ppp/lcp.c
  106. ${LWIPDIR}/netif/ppp/magic.c
  107. ${LWIPDIR}/netif/ppp/mppe.c
  108. ${LWIPDIR}/netif/ppp/multilink.c
  109. ${LWIPDIR}/netif/ppp/ppp.c
  110. ${LWIPDIR}/netif/ppp/pppapi.c
  111. ${LWIPDIR}/netif/ppp/pppcrypt.c
  112. ${LWIPDIR}/netif/ppp/pppoe.c
  113. ${LWIPDIR}/netif/ppp/pppol2tp.c
  114. ${LWIPDIR}/netif/ppp/pppos.c
  115. ${LWIPDIR}/netif/ppp/upap.c
  116. ${LWIPDIR}/netif/ppp/utils.c
  117. ${LWIPDIR}/netif/ppp/vj.c
  118. ${LWIPDIR}/netif/ppp/polarssl/md5.c
  119. # $(LWIPDIR)/netif/ppp/polarssl/arc4.c
  120. # $(LWIPDIR)/netif/ppp/polarssl/des.c
  121. # $(LWIPDIR)/netif/ppp/polarssl/md4.c
  122. # $(LWIPDIR)/netif/ppp/polarssl/md5.c
  123. # $(LWIPDIR)/netif/ppp/polarssl/sha1.c
  124. )
  125. # LWIPNOAPPSFILES: All LWIP files without apps
  126. set(LWIPNOAPPSFILES ${COREFILES}
  127. ${CORE4FILES}
  128. ${CORE6FILES}
  129. ${APIFILES}
  130. ${NETIFFILES}
  131. ${PPPFILES}
  132. ${SIXLOWPAN}
  133. )
  134. if (NOT CONFIG_QUEC_PROJECT_FEATURE)
  135. # SNMPFILES: SNMPv2c agent
  136. set(SNMPFILES ${LWIPDIR}/apps/snmp/snmp_asn1.c
  137. ${LWIPDIR}/apps/snmp/snmp_core.c
  138. ${LWIPDIR}/apps/snmp/snmp_mib2.c
  139. ${LWIPDIR}/apps/snmp/snmp_mib2_icmp.c
  140. ${LWIPDIR}/apps/snmp/snmp_mib2_interfaces.c
  141. ${LWIPDIR}/apps/snmp/snmp_mib2_ip.c
  142. ${LWIPDIR}/apps/snmp/snmp_mib2_snmp.c
  143. ${LWIPDIR}/apps/snmp/snmp_mib2_system.c
  144. ${LWIPDIR}/apps/snmp/snmp_mib2_tcp.c
  145. ${LWIPDIR}/apps/snmp/snmp_mib2_udp.c
  146. ${LWIPDIR}/apps/snmp/snmp_snmpv2_framework.c
  147. ${LWIPDIR}/apps/snmp/snmp_snmpv2_usm.c
  148. ${LWIPDIR}/apps/snmp/snmp_msg.c
  149. ${LWIPDIR}/apps/snmp/snmpv3.c
  150. ${LWIPDIR}/apps/snmp/snmp_netconn.c
  151. ${LWIPDIR}/apps/snmp/snmp_pbuf_stream.c
  152. ${LWIPDIR}/apps/snmp/snmp_raw.c
  153. ${LWIPDIR}/apps/snmp/snmp_scalar.c
  154. ${LWIPDIR}/apps/snmp/snmp_table.c
  155. ${LWIPDIR}/apps/snmp/snmp_threadsync.c
  156. ${LWIPDIR}/apps/snmp/snmp_traps.c
  157. )
  158. # HTTPDFILES: HTTP server
  159. set(HTTPDFILES ${LWIPDIR}/apps/http/altcp_proxyconnect.c
  160. ${LWIPDIR}/apps/http/fs.c
  161. ${LWIPDIR}/apps/http/http_client.c
  162. ${LWIPDIR}/apps/http/httpd.c
  163. )
  164. # MAKEFSDATA HTTP server host utility
  165. #set(LWIPMAKEFSDATA ${LWIPDIR}/apps/http/makefsdata/makefsdata.c
  166. #)
  167. # LWIPERFFILES: IPERF server
  168. set(LWIPERFFILES ${LWIPDIR}/apps/lwiperf/lwiperf.c
  169. )
  170. # SMTPFILES: SMTP client
  171. set(SMTPFILES ${LWIPDIR}/apps/smtp/smtp.c
  172. )
  173. # SNTPFILES: SNTP client
  174. set(SNTPFILES ${LWIPDIR}/apps/sntp/sntp.c
  175. )
  176. # MDNSFILES: MDNS responder
  177. set(MDNSFILES ${LWIPDIR}/apps/mdns/mdns.c
  178. )
  179. # NETBIOSNSFILES: NetBIOS name server
  180. set(NETBIOSNSFILES ${LWIPDIR}/apps/netbiosns/netbiosns.c
  181. )
  182. # TFTPFILES: TFTP server files
  183. set(TFTPFILES ${LWIPDIR}/apps/tftp/tftp.c
  184. )
  185. # MQTTFILES: MQTT client files
  186. set(MQTTFILES ${LWIPDIR}/apps/mqtt/mqtt.c
  187. )
  188. # MBEDTLS_FILES: MBEDTLS related files of lwIP rep
  189. set(MBEDTLS_FILES ${LWIPDIR}/apps/altcp_tls/altcp_tls_mbedtls.c
  190. ${LWIPDIR}/apps/altcp_tls/altcp_tls_mbedtls_mem.c
  191. ${LWIPDIR}/apps/snmp/snmpv3_mbedtls.c
  192. )
  193. # LWIPAPPFILES: All LWIP APPs
  194. set(LWIPAPPFILES ${SNMPFILES}
  195. # ${HTTPDFILES}
  196. # ${LWIPMAKEFSDATA}
  197. # ${LWIPERFFILES}
  198. # ${SMTPFILES}
  199. ${SNTPFILES}
  200. # ${MDNSFILES}
  201. # ${NETBIOSNSFILES}
  202. # ${TFTPFILES}
  203. ${MQTTFILES}
  204. ${MBEDTLS_FILES}
  205. )
  206. endif()
  207. target_sources(${target} PRIVATE
  208. ${LWIPNOAPPSFILES}
  209. ${LWIPAPPFILES}
  210. )