2
0

CMakeLists.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. # The strategy is to only export to PARENT_SCOPE
  25. #
  26. # - changes to LIB_LIST
  27. # - changes to SOURCES
  28. # - includes via include_directories
  29. #
  30. # and keep everything else private
  31. include_directories(.)
  32. list(APPEND SOURCES
  33. misc/base64-decode.c
  34. misc/lws-ring.c)
  35. if (LWS_WITH_FTS)
  36. list(APPEND SOURCES
  37. misc/fts/trie.c
  38. misc/fts/trie-fd.c)
  39. endif()
  40. if (LWS_WITH_DISKCACHE)
  41. list(APPEND SOURCES
  42. misc/diskcache.c)
  43. endif()
  44. if (LWS_WITH_STRUCT_JSON)
  45. list(APPEND SOURCES
  46. misc/lws-struct-lejp.c)
  47. endif()
  48. if (LWS_WITH_STRUCT_SQLITE3)
  49. list(APPEND SOURCES
  50. misc/lws-struct-sqlite.c)
  51. endif()
  52. if (LWS_WITH_FSMOUNT AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
  53. list(APPEND SOURCES misc/fsmount.c)
  54. endif()
  55. if (LWS_WITH_DIR)
  56. list(APPEND SOURCES misc/dir.c)
  57. endif()
  58. if (LWS_WITH_THREADPOOL AND LWS_HAVE_PTHREAD_H)
  59. list(APPEND SOURCES misc/threadpool/threadpool.c)
  60. endif()
  61. if (LWS_WITH_PEER_LIMITS)
  62. list(APPEND SOURCES
  63. misc/peer-limits.c)
  64. endif()
  65. if (LWS_WITH_LWSAC)
  66. list(APPEND SOURCES
  67. misc/lwsac/lwsac.c)
  68. if (NOT LWS_PLAT_FREERTOS)
  69. list(APPEND SOURCES
  70. misc/lwsac/cached-file.c)
  71. endif()
  72. endif()
  73. if (NOT LWS_WITHOUT_BUILTIN_SHA1)
  74. list(APPEND SOURCES
  75. misc/sha-1.c)
  76. endif()
  77. if (LWS_WITH_LEJP)
  78. list(APPEND SOURCES
  79. misc/lejp.c)
  80. endif()
  81. if (UNIX)
  82. if (NOT LWS_HAVE_GETIFADDRS)
  83. list(APPEND HDR_PRIVATE misc/getifaddrs.h)
  84. list(APPEND SOURCES misc/getifaddrs.c)
  85. endif()
  86. endif()
  87. if (NOT WIN32 AND NOT LWS_WITHOUT_DAEMONIZE)
  88. list(APPEND SOURCES
  89. misc/daemonize.c)
  90. endif()
  91. #
  92. # Keep explicit parent scope exports at end
  93. #
  94. exports_to_parent_scope()