2019-02-20 18:59:07 -08:00
|
|
|
#
|
|
|
|
# Author: Benjamin Sergeant
|
|
|
|
# Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 3.4.1)
|
2019-02-21 21:24:53 -08:00
|
|
|
project (ws)
|
2019-02-20 18:59:07 -08:00
|
|
|
|
|
|
|
# There's -Weverything too for clang
|
2019-04-16 18:51:57 +03:00
|
|
|
if (NOT WIN32)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
|
|
|
|
endif()
|
2019-02-20 18:59:07 -08:00
|
|
|
|
2019-04-22 17:24:01 -07:00
|
|
|
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
|
|
|
|
# set(CMAKE_LD_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
|
2019-04-11 16:03:05 -07:00
|
|
|
|
2019-02-20 18:59:07 -08:00
|
|
|
set (CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
option(USE_TLS "Add TLS support" ON)
|
|
|
|
|
2019-02-21 21:24:53 -08:00
|
|
|
include_directories(ws .)
|
2019-02-22 20:49:26 -08:00
|
|
|
include_directories(ws ..)
|
2019-02-21 21:24:53 -08:00
|
|
|
include_directories(ws ../third_party)
|
2019-04-08 21:52:20 -07:00
|
|
|
include_directories(ws ../third_party/statsd-client-cpp/src)
|
2019-05-09 15:30:44 -07:00
|
|
|
include_directories(ws ../third_party/spdlog/include)
|
2019-07-25 11:54:50 -07:00
|
|
|
include_directories(ws ../third_party/cpp-linenoise)
|
2019-02-20 18:59:07 -08:00
|
|
|
|
2019-06-02 20:46:20 -07:00
|
|
|
if (UNIX)
|
|
|
|
set( STATSD_CLIENT_SOURCES ../third_party/statsd-client-cpp/src/statsd_client.cpp)
|
|
|
|
endif()
|
|
|
|
|
2019-02-21 21:24:53 -08:00
|
|
|
add_executable(ws
|
|
|
|
../third_party/msgpack11/msgpack11.cpp
|
2019-04-08 21:52:20 -07:00
|
|
|
../third_party/jsoncpp/jsoncpp.cpp
|
2019-06-02 20:46:20 -07:00
|
|
|
${STATSD_CLIENT_SOURCES}
|
2019-04-21 11:20:17 -07:00
|
|
|
|
2019-04-11 16:03:05 -07:00
|
|
|
IXSentryClient.cpp
|
2019-03-20 14:29:02 -07:00
|
|
|
|
2019-02-28 21:54:03 -08:00
|
|
|
ws_http_client.cpp
|
2019-02-22 21:47:57 -08:00
|
|
|
ws_ping_pong.cpp
|
2019-02-22 21:13:56 -08:00
|
|
|
ws_broadcast_server.cpp
|
|
|
|
ws_echo_server.cpp
|
2019-02-22 20:49:26 -08:00
|
|
|
ws_chat.cpp
|
|
|
|
ws_connect.cpp
|
2019-02-21 21:24:53 -08:00
|
|
|
ws_transfer.cpp
|
|
|
|
ws_send.cpp
|
|
|
|
ws_receive.cpp
|
2019-03-20 14:29:02 -07:00
|
|
|
ws_redis_publish.cpp
|
|
|
|
ws_redis_subscribe.cpp
|
2019-09-23 21:04:01 -07:00
|
|
|
ws_redis_server.cpp
|
2019-09-23 11:46:16 -07:00
|
|
|
ws_snake.cpp
|
2019-04-08 21:52:20 -07:00
|
|
|
ws_cobra_subscribe.cpp
|
2019-09-19 12:51:11 -07:00
|
|
|
ws_cobra_metrics_publish.cpp
|
2019-04-21 11:16:33 -07:00
|
|
|
ws_cobra_publish.cpp
|
2019-04-08 21:52:20 -07:00
|
|
|
ws_cobra_to_statsd.cpp
|
2019-04-11 16:03:05 -07:00
|
|
|
ws_cobra_to_sentry.cpp
|
2019-06-23 14:54:21 -07:00
|
|
|
ws_httpd.cpp
|
2019-08-31 16:46:44 -07:00
|
|
|
ws_autobahn.cpp
|
2019-02-21 21:24:53 -08:00
|
|
|
ws.cpp)
|
2019-02-20 18:59:07 -08:00
|
|
|
|
2019-09-23 12:30:46 -07:00
|
|
|
target_link_libraries(ws ixsnake)
|
2019-09-10 12:19:22 -07:00
|
|
|
target_link_libraries(ws ixcobra)
|
2019-02-21 21:24:53 -08:00
|
|
|
target_link_libraries(ws ixwebsocket)
|
2019-09-23 12:30:46 -07:00
|
|
|
target_link_libraries(ws ixcrypto)
|
|
|
|
target_link_libraries(ws ixcore)
|
2019-04-16 18:51:57 +03:00
|
|
|
|
2019-06-02 20:46:20 -07:00
|
|
|
if(NOT APPLE AND NOT USE_MBED_TLS)
|
2019-04-16 18:51:57 +03:00
|
|
|
find_package(OpenSSL REQUIRED)
|
|
|
|
add_definitions(${OPENSSL_DEFINITIONS})
|
|
|
|
message(STATUS "OpenSSL: " ${OPENSSL_VERSION})
|
|
|
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
|
|
|
target_link_libraries(ws ${OPENSSL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2019-02-21 22:05:30 -08:00
|
|
|
install(TARGETS ws RUNTIME DESTINATION bin)
|