Skip to content

Commit

Permalink
cache false 优化
Browse files Browse the repository at this point in the history
  • Loading branch information
WentsingNee committed Aug 1, 2024
1 parent 68d2e82 commit d50d82d
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions cmake/Modules/coroutine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ function(kerbal_check_supports_coroutine_flags _Out_support)
endfunction()


function(__kerbal_cache_not_supports_coroutine)
set(KERBAL_SUPPORT_COROUTINE False CACHE BOOL "Whether compiler support coroutine")
message(STATUS "set KERBAL_SUPPORT_COROUTINE = False")
endfunction()


function(__kerbal_cache_result_of_supports_coroutine_flags support)
set(flags ${ARGN})
set(KERBAL_SUPPORT_COROUTINE ${support} CACHE BOOL "Whether compiler support coroutine")
Expand Down Expand Up @@ -90,7 +84,7 @@ function(kerbal_coroutine_required)

if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if ((CMAKE_CXX_STANDARD EQUAL 98) OR (CMAKE_CXX_STANDARD LESS 14))
__kerbal_cache_not_supports_coroutine()
__kerbal_cache_result_of_supports_coroutine_flags(False)
return()
endif ()
set_property(GLOBAL PROPERTY KERBAL_FLAGS_TEST_COROUTINE -fcoroutines)
Expand All @@ -99,7 +93,7 @@ function(kerbal_coroutine_required)
)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if ((CMAKE_CXX_STANDARD EQUAL 98) OR (CMAKE_CXX_STANDARD LESS 20))
__kerbal_cache_not_supports_coroutine()
__kerbal_cache_result_of_supports_coroutine_flags(False)
return()
endif ()
set_property(GLOBAL PROPERTY KERBAL_FLAGS_TEST_COROUTINE -fcoroutines)
Expand All @@ -114,7 +108,7 @@ function(kerbal_coroutine_required)
KERBAL_FLAGS_TEST_COROUTINE_MSVC
)
else ()
__kerbal_cache_not_supports_coroutine()
__kerbal_cache_result_of_supports_coroutine_flags(False)
endif ()
message("\n")
endfunction()
Expand Down

0 comments on commit d50d82d

Please sign in to comment.