Compile TWebSocketServer with CMake only when OpenSSL is found
When compiling the C++ library and OpenSSL wasn't found, TWebSocketServer will fail as it includes OpenSSL headers.
diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt
index c84e6e2..13b41c5 100755
--- a/lib/cpp/CMakeLists.txt
+++ b/lib/cpp/CMakeLists.txt
@@ -54,8 +54,6 @@
src/thrift/transport/TServerSocket.cpp
src/thrift/transport/TTransportUtils.cpp
src/thrift/transport/TBufferTransports.cpp
- src/thrift/transport/TWebSocketServer.h
- src/thrift/transport/TWebSocketServer.cpp
src/thrift/transport/SocketCommon.cpp
src/thrift/server/TConnectedClient.cpp
src/thrift/server/TServerFramework.cpp
@@ -102,6 +100,8 @@
list(APPEND thriftcpp_SOURCES
src/thrift/transport/TSSLSocket.cpp
src/thrift/transport/TSSLServerSocket.cpp
+ src/thrift/transport/TWebSocketServer.h
+ src/thrift/transport/TWebSocketServer.cpp
)
if(TARGET OpenSSL::SSL OR TARGET OpenSSL::Crypto)
if(TARGET OpenSSL::SSL)