-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
34 lines (30 loc) · 1.08 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required (VERSION 3.0)
project (LIBWIRE)
if ( ${UNIX} )
execute_process(COMMAND bash -c "${CMAKE_C_COMPILER} -v 2>&1 | grep Target: | cut -f2 -d' ' | cut -f1 -d- "
OUTPUT_VARIABLE ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
MESSAGE(STATUS "ARCH: ${ARCH}")
if ( ${ARCH} STREQUAL "x86_64")
MESSAGE(STATUS "Using internal (libcoro inspired) for coroutine implementation (faster)")
set(USE_CORO 0)
else()
MESSAGE(STATUS "Using libcoro for non x86-64 arch")
set(USE_CORO 1)
endif()
else()
MESSAGE(STATUS "Using libcoro for coroutine implementation")
set(USE_CORO 1)
endif()
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
set(WIRE_DEFER_SUPPORTED 1)
else()
set(WIRE_DEFER_SUPPORTED 0)
endif()
add_subdirectory (src)
if ( ${CMAKE_PROJECT_NAME} STREQUAL "LIBWIRE" )
add_subdirectory (test)
MESSAGE(STATUS "top level project, compiling tests")
else()
MESSAGE(STATUS "tests will not be compiled")
endif()