Skip to content

Commit

Permalink
Update CMake config
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Jun 3, 2024
1 parent a4d3fb0 commit f793b21
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,15 @@ IF(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
TARGET_COMPILE_OPTIONS(libnetwrk INTERFACE "-fconcepts")
TARGET_COMPILE_OPTIONS(libnetwrk INTERFACE "-fcoroutines")

CHECK_INCLUDE_FILE_CXX("coroutine" LIBNETWRK_HAS_COROUTINE "-fcoroutines")
CHECK_INCLUDE_FILE_CXX("experimental/coroutine" LIBNETWRK_HAS_COROUTINE_EXP "-fcoroutines")
CHECK_INCLUDE_FILE_CXX("coroutine" LIBNETWRK_HAS_COROUTINE "-fcoroutines")
ELSEIF(WIN32)
CHECK_INCLUDE_FILE_CXX("coroutine" LIBNETWRK_HAS_COROUTINE)
CHECK_INCLUDE_FILE_CXX("experimental/coroutine" LIBNETWRK_HAS_COROUTINE_EXP)
CHECK_INCLUDE_FILE_CXX("coroutine" LIBNETWRK_HAS_COROUTINE)
ENDIF()

IF(NOT LIBNETWRK_HAS_COROUTINE AND NOT LIBNETWRK_HAS_COROUTINE_EXP)
IF(LIBNETWRK_HAS_COROUTINE)
TARGET_COMPILE_DEFINITIONS(libnetwrk INTERFACE -DASIO_HAS_STD_COROUTINE)
ELSE()
MESSAGE(FATAL_ERROR "Failed to find coroutine headers.'")
ENDIF()

TARGET_COMPILE_DEFINITIONS(libnetwrk INTERFACE -DASIO_HAS_CO_AWAIT)

IF(LIBNETWRK_HAS_COROUTINE)
TARGET_COMPILE_DEFINITIONS(libnetwrk INTERFACE -DASIO_HAS_STD_COROUTINE)
ENDIF()

0 comments on commit f793b21

Please sign in to comment.