diff options
| author | info@mode42.com <info@mode42.com> | 2026-08-08 03:54:55 +0000 |
|---|---|---|
| committer | info@mode42.com <info@mode42.com> | 2026-08-08 03:54:55 +0000 |
| commit | 20cb29c2f8c5c87bc590896854a20b1473ceb358 (patch) | |
| tree | 2857f41513a56ad41af97b57362639298aa7f033 /plugins/websocket/CMakeLists.txt | |
#2
Diffstat (limited to 'plugins/websocket/CMakeLists.txt')
| -rw-r--r-- | plugins/websocket/CMakeLists.txt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/plugins/websocket/CMakeLists.txt b/plugins/websocket/CMakeLists.txt new file mode 100644 index 0000000..a63f83d --- /dev/null +++ b/plugins/websocket/CMakeLists.txt @@ -0,0 +1,37 @@ +add_library(hybbx_plugin_websocket STATIC + websocket.c + ws_config.c + ws_proto.c + ws_sha1.c + ws_tls.c +) + +find_package(Threads REQUIRED) + +target_include_directories(hybbx_plugin_websocket + PRIVATE ${CMAKE_SOURCE_DIR}/include +) + +target_compile_definitions(hybbx_plugin_websocket + PRIVATE HYBBX_PLUGIN_BUILD +) + +find_package(OpenSSL QUIET) +if(OpenSSL_FOUND) + target_compile_definitions(hybbx_plugin_websocket PRIVATE HYBBX_WS_HAVE_TLS) + target_link_libraries(hybbx_plugin_websocket PRIVATE OpenSSL::SSL OpenSSL::Crypto) + message(STATUS "WebSocket plugin: OpenSSL found — wss + self-signed certs") +else() + message(STATUS "WebSocket plugin: OpenSSL not found — plain ws only") +endif() + +target_link_libraries(hybbx_plugin_websocket PRIVATE hybbx_core Threads::Threads) +hybbx_link_plugin_instances(hybbx_plugin_websocket HYBBX_HAVE_PLUGIN_WEBSOCKET) +hybbx_apply_hardening(hybbx_plugin_websocket) + +if(HYBBX_INSTALL_DEV) +install(TARGETS hybbx_plugin_websocket + ARCHIVE DESTINATION ${HYBBX_PLUGIN_INSTALL_DIR} + LIBRARY DESTINATION ${HYBBX_PLUGIN_INSTALL_DIR} +) +endif() |
