CMakeLists.txt 913 Bytes
Newer Older
1 2
add_subdirectory(deboost.context)

3 4
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
    SET(SWITCH_ASSEMBLY "custom_stack_callback_x86_64.s")
5
    SET(FIBER_ASSEMBLY "fiber_call_x86_64.s" "fiber_continue_x86_64.s")
6
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
7
    SET(SWITCH_ASSEMBLY "custom_stack_callback_arm32.s" fiber_call.h context_switcher.cpp)
8
    SET(FIBER_ASSEMBLY "fiber_call_arm32.s" "fiber_continue_arm32.s")
9 10 11 12 13
else ()
    MESSAGE(FATAL_ERROR "Platform (${CMAKE_SYSTEM_PROCESSOR} on ${CMAKE_SYSTEM_NAME}) not supported! Please see Readme for instructions to port.")
endif ()


14 15 16
add_executable(context_switch
        main.cpp
        ${SWITCH_ASSEMBLY}
17
        fiber_call.h
18
        ${FIBER_ASSEMBLY})
19 20

# Example for adding the library to your app (as a cmake project dependency)
21
target_link_libraries(context_switch fcontext)