CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. src/permissions.cpp
  28. src/authorization_service.cpp
  29. )
  30. target_include_directories(smartbotic_webserver
  31. PUBLIC
  32. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  33. $<INSTALL_INTERFACE:include>
  34. )
  35. target_compile_options(smartbotic_webserver PRIVATE ${SMARTBOTIC_WEBSERVER_WARNINGS})
  36. target_link_libraries(smartbotic_webserver
  37. PUBLIC
  38. smartbotic::common
  39. smartbotic::proto
  40. spdlog::spdlog
  41. nlohmann_json::nlohmann_json
  42. httplib::httplib
  43. PkgConfig::LWS
  44. OpenSSL::SSL
  45. OpenSSL::Crypto
  46. jwt-cpp::jwt-cpp
  47. sodium
  48. )
  49. add_library(smartbotic::webserver ALIAS smartbotic_webserver)
  50. # Create the executable
  51. add_executable(smartbotic-crm-webserver
  52. src/main.cpp
  53. )
  54. target_include_directories(smartbotic-crm-webserver
  55. PRIVATE
  56. ${CMAKE_CURRENT_SOURCE_DIR}/include
  57. )
  58. target_compile_options(smartbotic-crm-webserver PRIVATE ${SMARTBOTIC_WEBSERVER_WARNINGS})
  59. target_link_libraries(smartbotic-crm-webserver
  60. PRIVATE
  61. smartbotic::webserver
  62. smartbotic::common
  63. smartbotic::proto
  64. spdlog::spdlog
  65. nlohmann_json::nlohmann_json
  66. sodium
  67. )