Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch-off uthread on not supported platform (#66)
Signed-off-by: Rain Mark <rain.by.zhou@gmail.com>
- Loading branch information
Showing
11 changed files
with
101 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,65 @@ | ||
file(GLOB coro_src "coro/*.cpp") | ||
file(GLOB executors_src "executors/*.cpp") | ||
file(GLOB uthread_src "uthread/internal/*.cc") | ||
|
||
EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE) | ||
if ("${ARCHITECTURE}" STREQUAL "aarch64") | ||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # uname -s | ||
file(GLOB uthread_src "uthread/internal/*.cc") | ||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") # uname -p | ||
file(GLOB uthread_asm_src "uthread/internal/*arm64_aapcs_elf*") | ||
elseif ("${ARCHITECTURE}" STREQUAL "x86_64") | ||
set(UTHREAD ON) | ||
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") | ||
file(GLOB uthread_asm_src "uthread/internal/*x86_64_sysv_elf*") | ||
else() | ||
message(FATAL_ERROR "Unsupported Target: ${ARCHITECTURE}") | ||
set(UTHREAD ON) | ||
else() | ||
message(STATUS "Uthread Unsupported Target: ${CMAKE_SYSTEM_PROCESSOR}") | ||
endif() | ||
endif() | ||
|
||
file(GLOB headers "*.h") | ||
file(GLOB coro_header "coro/*.h") | ||
file(GLOB executors_header "executors/*.h") | ||
file(GLOB experimental_header "experimental/*.h") | ||
file(GLOB util_header "util/*.h") | ||
file(GLOB uthread_header "uthread/*.h") | ||
file(GLOB uthread_internal_header "uthread/internal/*.h") | ||
if(UTHREAD) | ||
file(GLOB uthread_header "uthread/*.h") | ||
file(GLOB uthread_internal_header "uthread/internal/*.h") | ||
endif() | ||
|
||
message(STATUS "uthread_asm_src: ${uthread_asm_src}") | ||
|
||
set(SRCS | ||
${coro_src} | ||
${executors_src} | ||
${uthread_asm_src} | ||
${uthread_src} | ||
) | ||
${coro_src} | ||
${executors_src} | ||
) | ||
if(UTHREAD) | ||
list(APPEND SRCS ${uthread_src}) | ||
list(APPEND SRCS ${uthread_asm_src}) | ||
endif() | ||
|
||
add_library(async_simple_static STATIC ${SRCS}) | ||
add_library(async_simple SHARED ${SRCS}) | ||
target_link_libraries(async_simple ${deplibs}) | ||
target_link_libraries(async_simple_static ${deplibs}) | ||
if(SRCS) | ||
add_library(async_simple_static STATIC ${SRCS}) | ||
add_library(async_simple SHARED ${SRCS}) | ||
target_link_libraries(async_simple ${deplibs}) | ||
target_link_libraries(async_simple_static ${deplibs}) | ||
|
||
set_target_properties(async_simple_static PROPERTIES OUTPUT_NAME "async_simple") | ||
set_target_properties(async_simple_static PROPERTIES OUTPUT_NAME "async_simple") | ||
|
||
install(TARGETS async_simple DESTINATION lib/) | ||
install(TARGETS async_simple_static DESTINATION lib/) | ||
install(TARGETS async_simple DESTINATION lib/) | ||
install(TARGETS async_simple_static DESTINATION lib/) | ||
endif() | ||
|
||
install(FILES ${headers} DESTINATION include/async_simple) | ||
install(FILES ${coro_header} DESTINATION include/async_simple/coro) | ||
install(FILES ${executors_header} DESTINATION include/async_simple/executors) | ||
install(FILES ${experimental_header} DESTINATION include/async_simple/experimental) | ||
install(FILES ${util_header} DESTINATION include/async_simple/util) | ||
install(FILES ${uthread_header} DESTINATION include/async_simple/uthread) | ||
install(FILES ${uthread_internal_header} DESTINATION include/async_simple/uthread/internal) | ||
if(UTHREAD) | ||
install(FILES ${uthread_header} DESTINATION include/async_simple/uthread) | ||
install(FILES ${uthread_internal_header} DESTINATION include/async_simple/uthread/internal) | ||
endif() | ||
|
||
add_subdirectory(test) | ||
add_subdirectory(util/test) | ||
add_subdirectory(coro/test) | ||
add_subdirectory(executors/test) | ||
add_subdirectory(uthread/test) | ||
if(UTHREAD) | ||
add_subdirectory(uthread/test) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
file(GLOB coro_test_src "*.cpp") | ||
add_executable(async_simple_coro_test ${coro_test_src} ${PROJECT_SOURCE_DIR}/async_simple/test/dotest.cpp) | ||
|
||
target_link_libraries(async_simple_coro_test async_simple ${deplibs} ${testdeplibs}) | ||
target_link_libraries(async_simple_coro_test ${deplibs} ${testdeplibs}) | ||
|
||
add_test(NAME run_async_simple_coro_test COMMAND async_simple_coro_test) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
file(GLOB executor_test_src "*.cpp") | ||
add_executable(async_simple_executor_test ${executor_test_src} ${PROJECT_SOURCE_DIR}/async_simple/test/dotest.cpp) | ||
|
||
target_link_libraries(async_simple_executor_test async_simple ${deplibs} ${testdeplibs}) | ||
target_link_libraries(async_simple_executor_test ${deplibs} ${testdeplibs}) | ||
|
||
add_test(NAME run_async_simple_executor_test COMMAND async_simple_executor_test) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
file(GLOB test_src "*.cpp") | ||
add_executable(async_simple_test ${test_src}) | ||
|
||
target_link_libraries(async_simple_test async_simple ${deplibs} ${testdeplibs}) | ||
target_link_libraries(async_simple_test ${deplibs} ${testdeplibs}) | ||
|
||
add_test(NAME run_async_simple_test COMMAND async_simple_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
file(GLOB util_test_src "*.cpp") | ||
add_executable(async_simple_util_test ${util_test_src} ${PROJECT_SOURCE_DIR}/async_simple/test/dotest.cpp) | ||
|
||
target_link_libraries(async_simple_util_test async_simple ${deplibs} ${testdeplibs}) | ||
target_link_libraries(async_simple_util_test ${deplibs} ${testdeplibs}) | ||
|
||
add_test(NAME run_async_simple_util_test COMMAND async_simple_util_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b7b5e1b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this one hit an infinite loop.