From 2670187fe020dfaa6532fcab6d91a5f6b4d37c4a Mon Sep 17 00:00:00 2001 From: inull <10429190+innerNULL@users.noreply.github.com> Date: Mon, 22 Mar 2021 23:47:10 +0800 Subject: [PATCH] Adds demo building option. (#278) --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a63d6b1..3370d450 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,8 @@ set (CMAKE_CXX_STANDARD 11) set (CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_EXTENSIONS OFF) +option (BUILD_DEMO OFF) + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_POSITION_INDEPENDENT_CODE ON) endif() @@ -274,3 +276,8 @@ if (USE_WS OR USE_TEST) add_subdirectory(test) endif() endif() + +if (BUILD_DEMO) + add_executable(demo main.cpp) + target_link_libraries(demo ixwebsocket) +endif()