diff options
author | eidheim <eidheim@gmail.com> | 2020-06-26 19:53:34 +0300 |
---|---|---|
committer | eidheim <eidheim@gmail.com> | 2020-06-26 19:53:34 +0300 |
commit | 28dd555339f5b17c88d1d5bbc9188bda999b6176 (patch) | |
tree | 4462b931dab71347753ce96f2ceb654068c70bb5 | |
parent | 5eacfe6b229677d2b851052872e8b3ee9f72112f (diff) |
Do not run add_compile_options when Simple-WebSocket-Server is a sub-project
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9429d..9d2d4f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,15 +5,6 @@ project (Simple-WebSocket-Server) option(USE_STANDALONE_ASIO "set ON to use standalone Asio instead of Boost.Asio" OFF) option(BUILD_TESTING "set ON to build library tests" OFF) -if(NOT MSVC) - add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion) - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wthread-safety) - endif() -else() - add_compile_options(/W1) -endif() - add_library(simple-websocket-server INTERFACE) target_include_directories(simple-websocket-server INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) @@ -55,6 +46,15 @@ target_include_directories(simple-websocket-server INTERFACE ${OPENSSL_INCLUDE_D # If Simple-WebSocket-Server is not a sub-project: if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + if(NOT MSVC) + add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wthread-safety) + endif() + else() + add_compile_options(/W1) + endif() + add_executable(ws_examples ws_examples.cpp) target_link_libraries(ws_examples simple-websocket-server) add_executable(wss_examples wss_examples.cpp) |