From fba60e07d55b154d92fcd928ad9fa616df93c07e Mon Sep 17 00:00:00 2001 From: test Date: Sat, 23 Jan 2016 03:11:24 -0800 Subject: [PATCH] =?UTF-8?q?CMake=E5=8F=82=E6=95=B0=E4=BA=92=E6=96=A5?= =?UTF-8?q?=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index dda077c6..5ec38237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ if (ENABLE_SHARED_STACK) add_definitions(-DENABLE_SHARED_STACK) endif() +# 选项互斥检查 if (UNIX) # unix like platforms aux_source_directory(${PROJECT_SOURCE_DIR}/src/linux CO_SRC_LIST) @@ -31,6 +32,10 @@ if (UNIX) set(CXX_FLAGS_POSTFIX "-fsplit-stack -DBOOST_USE_SEGMENTED_STACKS") set(TEST_LINK_FLAGS "-fuse-ld=gold") endif() + + if (ENABLE_SHARED_STACK) + message(FATAL_ERROR "ENABLE_SHARED_STACK cannot used with ENABLE_BOOST_COROUTINE") + endif() else () aux_source_directory(${PROJECT_SOURCE_DIR}/src/ctx_ucontext CO_SRC_LIST) if (ENABLE_SEGMENTED_STACK) @@ -53,10 +58,15 @@ elseif (WIN32) if (ENABLE_BOOST_COROUTINE) aux_source_directory(${PROJECT_SOURCE_DIR}/src/ctx_boost_coroutine CO_SRC_LIST) + message(WARNING "boost.coroutine was unstable in windows platform") else() aux_source_directory(${PROJECT_SOURCE_DIR}/src/ctx_win_fiber CO_SRC_LIST) endif() + if (ENABLE_SHARED_STACK) + message(FATAL_ERROR "ENABLE_SHARED_STACK depends unix like platforms") + endif() + if (ENABLE_SEGMENTED_STACK) message(FATAL_ERROR "ENABLE_SEGMENTED_STACK depends unix like platforms") endif()