diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index df11f50..3782bdf 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -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()