2020-08-19 17:37:42 +01:00
|
|
|
project(lws-api-test-lws_tokenize C)
|
2023-12-08 07:48:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2020-05-22 16:47:40 +01:00
|
|
|
find_package(libwebsockets CONFIG REQUIRED)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR})
|
2018-10-09 10:29:42 +08:00
|
|
|
include(CheckCSourceCompiles)
|
2020-05-22 16:47:40 +01:00
|
|
|
include(LwsCheckRequirements)
|
2018-10-09 10:29:42 +08:00
|
|
|
|
|
|
|
set(SAMP lws-api-test-lws_tokenize)
|
|
|
|
set(SRCS main.c)
|
|
|
|
|
2021-11-10 16:14:26 +00:00
|
|
|
set(requirements 1)
|
|
|
|
require_lws_config(LWS_ROLE_H1 1 requirements)
|
|
|
|
require_lws_config(LWS_WITH_NETWORK 1 requirements)
|
|
|
|
|
|
|
|
if (requirements)
|
|
|
|
|
2018-10-09 10:29:42 +08:00
|
|
|
add_executable(${SAMP} ${SRCS})
|
2020-04-14 19:04:13 +01:00
|
|
|
add_test(NAME api-test-lws_tokenize COMMAND lws-api-test-lws_tokenize)
|
2018-10-09 10:29:42 +08:00
|
|
|
|
|
|
|
if (websockets_shared)
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS})
|
2018-10-09 10:29:42 +08:00
|
|
|
add_dependencies(${SAMP} websockets_shared)
|
|
|
|
else()
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS})
|
2018-10-09 10:29:42 +08:00
|
|
|
endif()
|
2021-11-10 16:14:26 +00:00
|
|
|
|
|
|
|
endif()
|