Commit e9ce5447 authored by Dominik Charousset's avatar Dominik Charousset

added --disable-context-switching option

parent 37376c49
...@@ -22,6 +22,10 @@ else () ...@@ -22,6 +22,10 @@ else ()
set(CMAKE_BUILD_TYPE RelWithDebInfo) set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif () endif ()
if (DISABLE_CONTEXT_SWITCHING)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCPPA_DISABLE_CONTEXT_SWITCHING")
endif()
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION) OUTPUT_VARIABLE GCC_VERSION)
...@@ -91,31 +95,32 @@ set(LIBCPPA_SRC ...@@ -91,31 +95,32 @@ set(LIBCPPA_SRC
set(boost_context third_party/boost_context) set(boost_context third_party/boost_context)
# add third party Boost.Context sources # add third party Boost.Context sources if context-switching is enabled
if(CMAKE_SIZEOF_VOID_P EQUAL 4) if(NOT DISABLE_CONTEXT_SWITCHING)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
if(APPLE) if(APPLE)
set(fcontext_asm ${boost_context}/src/asm/fcontext_i386_sysv_macho_gas.S) set(fcontext_asm ${boost_context}/src/asm/fcontext_i386_sysv_macho_gas.S)
else() else()
set(fcontext_asm ${boost_context}/src/asm/fcontext_i386_sysv_elf_gas.S) set(fcontext_asm ${boost_context}/src/asm/fcontext_i386_sysv_elf_gas.S)
endif() endif()
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8) elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(APPLE) if(APPLE)
set(fcontext_asm ${boost_context}/src/asm/fcontext_x86_64_sysv_macho_gas.S) set(fcontext_asm ${boost_context}/src/asm/fcontext_x86_64_sysv_macho_gas.S)
else() else()
set(fcontext_asm ${boost_context}/src/asm/fcontext_x86_64_sysv_elf_gas.S) set(fcontext_asm ${boost_context}/src/asm/fcontext_x86_64_sysv_elf_gas.S)
endif() endif()
else() else()
message(FATAL_ERROR "Unsupported platform (neither 32 nor 64 bit)") message(FATAL_ERROR "Unsupported platform (neither 32 nor 64 bit)")
endif() endif()
set_property(SOURCE ${fcontext_asm} PROPERTY LANGUAGE CXX)
set_property(SOURCE ${fcontext_asm} PROPERTY LANGUAGE CXX) set(LIBCPPA_SRC
set(LIBCPPA_SRC
${LIBCPPA_SRC} ${LIBCPPA_SRC}
${fcontext_asm} ${fcontext_asm}
${boost_context}/src/stack_utils_posix.cpp ${boost_context}/src/stack_utils_posix.cpp
${boost_context}/src/stack_allocator_posix.cpp ${boost_context}/src/stack_allocator_posix.cpp
${boost_context}/src/fcontext.cpp ${boost_context}/src/fcontext.cpp
) )
endif()
find_package(Boost COMPONENTS thread REQUIRED) find_package(Boost COMPONENTS thread REQUIRED)
......
...@@ -32,6 +32,10 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -32,6 +32,10 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--enable-debug compile in debugging mode --enable-debug compile in debugging mode
--enable-perftools use Google perftools --enable-perftools use Google perftools
Platform-Dependent Adjustments:
--disable-context-switching compile libcppa without context-switching actors
on platforms where Boost.Context is not available
Required Packages in Non-Standard Locations: Required Packages in Non-Standard Locations:
--with-boost=PATH path to Boost install root --with-boost=PATH path to Boost install root
...@@ -113,6 +117,7 @@ builddir="$sourcedir/build" ...@@ -113,6 +117,7 @@ builddir="$sourcedir/build"
CMakeCacheEntries="" CMakeCacheEntries=""
append_cache_entry CMAKE_INSTALL_PREFIX PATH /usr/local append_cache_entry CMAKE_INSTALL_PREFIX PATH /usr/local
append_cache_entry ENABLE_DEBUG BOOL false append_cache_entry ENABLE_DEBUG BOOL false
append_cache_entry DISABLE_CONTEXT_SWITCHING BOOL false
# Parse arguments. # Parse arguments.
while [ $# -ne 0 ]; do while [ $# -ne 0 ]; do
...@@ -138,6 +143,9 @@ while [ $# -ne 0 ]; do ...@@ -138,6 +143,9 @@ while [ $# -ne 0 ]; do
--enable-debug) --enable-debug)
append_cache_entry ENABLE_DEBUG BOOL true append_cache_entry ENABLE_DEBUG BOOL true
;; ;;
--disable-context-switching)
append_cache_entry DISABLE_CONTEXT_SWITCHING BOOL true
;;
--with-boost=*) --with-boost=*)
append_cache_entry BOOST_ROOT PATH $optarg append_cache_entry BOOST_ROOT PATH $optarg
;; ;;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment