@@ -3,17 +3,21 @@ include(CheckIncludeFileCXX)
3
3
include (FindPackageHandleStandardArgs)
4
4
5
5
check_cxx_compiler_flag(/await Coroutines_SUPPORTS_MS_FLAG)
6
- check_cxx_compiler_flag(-fcoroutines-ts Coroutines_SUPPORTS_GNU_FLAG)
7
- if (Coroutines_SUPPORTS_MS_FLAG OR Coroutines_SUPPORTS_GNU_FLAG)
6
+ check_cxx_compiler_flag(-fcoroutines-ts Coroutines_ts_SUPPORTS_GNU_FLAG)
7
+ check_cxx_compiler_flag(-fcoroutines Coroutines_SUPPORTS_GNU_FLAG)
8
+ if (Coroutines_SUPPORTS_MS_FLAG OR Coroutines_ts_SUPPORTS_GNU_FLAG OR Coroutines_SUPPORTS_GNU_FLAG)
8
9
set (Coroutines_COMPILER_SUPPORT ON )
9
10
endif ()
10
11
11
12
if (Coroutines_SUPPORTS_MS_FLAG)
12
13
check_include_file_cxx("coroutine" Coroutines_STANDARD_LIBRARY_SUPPORT "/await" )
13
14
check_include_file_cxx("experimental/coroutine" Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT "/await" )
14
- elseif (Coroutines_SUPPORTS_GNU_FLAG )
15
+ elseif (Coroutines_ts_SUPPORTS_GNU_FLAG )
15
16
check_include_file_cxx("coroutine" Coroutines_STANDARD_LIBRARY_SUPPORT "-fcoroutines-ts" )
16
17
check_include_file_cxx("experimental/coroutine" Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT "-fcoroutines-ts" )
18
+ elseif (Coroutines_SUPPORTS_GNU_FLAG)
19
+ check_include_file_cxx("coroutine" Coroutines_STANDARD_LIBRARY_SUPPORT "-fcoroutines" )
20
+ check_include_file_cxx("experimental/coroutine" Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT "-fcoroutines" )
17
21
endif ()
18
22
19
23
if (Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT OR Coroutines_STANDARD_LIBRARY_SUPPORT)
@@ -31,6 +35,8 @@ endif()
31
35
add_library (cppcoro::coroutines INTERFACE IMPORTED )
32
36
if (Coroutines_SUPPORTS_MS_FLAG)
33
37
target_compile_options (cppcoro::coroutines INTERFACE /await)
34
- elseif (Coroutines_SUPPORTS_GNU_FLAG )
38
+ elseif (Coroutines_ts_SUPPORTS_GNU_FLAG )
35
39
target_compile_options (cppcoro::coroutines INTERFACE -fcoroutines-ts)
40
+ elseif (Coroutines_SUPPORTS_GNU_FLAG)
41
+ target_compile_options (cppcoro::coroutines INTERFACE -fcoroutines)
36
42
endif ()
0 commit comments