CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Web server - smartbotic-server binary
  2. # Use relaxed warnings for webserver (it includes gRPC headers which use __int128)
  3. set(SMARTBOTIC_WEBSERVER_WARNINGS
  4. -Wall
  5. -Wextra
  6. -Werror
  7. -Wno-unused-parameter
  8. -Wno-dangling-reference
  9. -Wno-pedantic # Required for abseil __int128 support
  10. -Wno-overflow # Required for abseil hash_set.h
  11. )
  12. # Create library for webserver components
  13. add_library(smartbotic_webserver STATIC
  14. src/config.cpp
  15. src/http_server.cpp
  16. src/database_client.cpp
  17. src/auth_service.cpp
  18. src/user_service.cpp
  19. src/workspace_service.cpp
  20. src/group_service.cpp
  21. src/membership_service.cpp
  22. src/api_key_service.cpp
  23. src/collection_service.cpp
  24. src/document_service.cpp
  25. src/ws_handler.cpp
  26. src/view_service.cpp
  27. )
  28. target_include_directories(smartbotic_webserver
  29. PUBLIC
  30. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  31. $<INSTALL_INTERFACE:include>
  32. )
  33. target_compile_options(smartbotic_webserver PRIVATE ${SMARTBOTIC_WEBSERVER_WARNINGS})
  34. target_link_libraries(smartbotic_webserver
  35. PUBLIC
  36. smartbotic::common
  37. smartbotic::proto
  38. spdlog::spdlog
  39. nlohmann_json::nlohmann_json
  40. httplib::httplib
  41. PkgConfig::LWS
  42. OpenSSL::SSL
  43. OpenSSL::Crypto
  44. jwt-cpp::jwt-cpp
  45. sodium
  46. )
  47. add_library(smartbotic::webserver ALIAS smartbotic_webserver)
  48. # Create the executable
  49. add_executable(smartbotic-crm-webserver
  50. src/main.cpp
  51. )
  52. target_include_directories(smartbotic-crm-webserver
  53. PRIVATE
  54. ${CMAKE_CURRENT_SOURCE_DIR}/include
  55. )
  56. target_compile_options(smartbotic-crm-webserver PRIVATE ${SMARTBOTIC_WEBSERVER_WARNINGS})
  57. target_link_libraries(smartbotic-crm-webserver
  58. PRIVATE
  59. smartbotic::webserver
  60. smartbotic::common
  61. smartbotic::proto
  62. spdlog::spdlog
  63. nlohmann_json::nlohmann_json
  64. sodium
  65. )