CMakeLists.txt 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #
  2. # libwebsockets - small server side websockets and web server implementation
  3. #
  4. # Copyright (C) 2010 - 2020 Andy Green <[email protected]>
  5. #
  6. # Permission is hereby granted, free of charge, to any person obtaining a copy
  7. # of this software and associated documentation files (the "Software"), to
  8. # deal in the Software without restriction, including without limitation the
  9. # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  10. # sell copies of the Software, and to permit persons to whom the Software is
  11. # furnished to do so, subject to the following conditions:
  12. #
  13. # The above copyright notice and this permission notice shall be included in
  14. # all copies or substantial portions of the Software.
  15. #
  16. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  21. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  22. # IN THE SOFTWARE.
  23. #
  24. include_directories(.)
  25. if (LWS_WITH_CLIENT)
  26. list(APPEND SOURCES
  27. secure-streams/secure-streams.c
  28. secure-streams/policy-common.c
  29. secure-streams/system/captive-portal-detect/captive-portal-detect.c
  30. secure-streams/protocols/ss-raw.c
  31. )
  32. if (NOT LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY)
  33. list(APPEND SOURCES
  34. secure-streams/policy-json.c
  35. secure-streams/system/fetch-policy/fetch-policy.c
  36. )
  37. endif()
  38. if (LWS_ROLE_H1)
  39. list(APPEND SOURCES
  40. secure-streams/protocols/ss-h1.c
  41. )
  42. endif()
  43. if (LWS_ROLE_H2)
  44. list(APPEND SOURCES
  45. secure-streams/protocols/ss-h2.c
  46. )
  47. endif()
  48. if (LWS_ROLE_WS)
  49. list(APPEND SOURCES
  50. secure-streams/protocols/ss-ws.c
  51. )
  52. endif()
  53. if (LWS_ROLE_MQTT)
  54. list(APPEND SOURCES
  55. secure-streams/protocols/ss-mqtt.c
  56. )
  57. endif()
  58. if (LWS_WITH_SECURE_STREAMS_PROXY_API)
  59. list(APPEND SOURCES
  60. secure-streams/secure-streams-serialize.c
  61. secure-streams/secure-streams-client.c
  62. )
  63. endif()
  64. if (LWS_WITH_SECURE_STREAMS_PROXY_API)
  65. list(APPEND SOURCES
  66. secure-streams/secure-streams-process.c
  67. )
  68. endif()
  69. if (LWS_WITH_SECURE_STREAMS_SYS_AUTH_API_AMAZON_COM AND
  70. LWS_WITH_SYS_STATE)
  71. list(APPEND SOURCES
  72. secure-streams/system/auth-api.amazon.com/auth.c
  73. )
  74. endif()
  75. #
  76. # Helper function for adding a secure stream plugin
  77. #
  78. macro(create_ss_plugin NAME S2 S3 S4 S5 S6)
  79. set(SSP_SRCS)
  80. set(SSP_PUBLIC_HDR)
  81. set(SSP_HDR)
  82. if ("${S2}" STREQUAL "")
  83. else()
  84. list(APPEND SSP_SRCS plugins/${NAME}/${S2})
  85. endif()
  86. if ("${S3}" STREQUAL "")
  87. else()
  88. list(APPEND SSP_SRCS plugins/${NAME}/${S3})
  89. endif()
  90. if ("${S4}" STREQUAL "")
  91. else()
  92. list(APPEND SSP_SRCS plugins/${NAME}/${S4})
  93. endif()
  94. if ("${S5}" STREQUAL "")
  95. else()
  96. list(APPEND SSP_SRCS plugins/${NAME}/${S5})
  97. endif()
  98. if ("${S6}" STREQUAL "")
  99. else()
  100. list(APPEND SSP_SRCS plugins/${NAME}/${S6})
  101. endif()
  102. source_group("Headers Private" FILES ${SSP_HDR})
  103. source_group("Sources" FILES ${SSP_SRCS})
  104. add_library( ${NAME} STATIC
  105. ${SSP_HDR} ${SSP_PUBLIC_HDR} ${SSP_SRCS} )
  106. target_include_directories(${NAME} PRIVATE "${LWS_LIB_INCLUDES}" ${LWS_LIB_BUILD_INC_PATHS})
  107. if (NOT LWS_PLAT_FREERTOS)
  108. add_dependencies(${NAME} websockets_shared)
  109. endif()
  110. list(APPEND SS_PLUGINS_LIST ${NAME})
  111. endmacro()
  112. # create_ss_plugin(ssp-h1url "h1url.c" "" "" "" "")
  113. endif()
  114. #
  115. # Keep explicit parent scope exports at end
  116. #
  117. exports_to_parent_scope()