@@ -3,23 +3,23 @@ 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_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 )
6
+ check_cxx_compiler_flag(-fcoroutines-ts Coroutines_SUPPORTS_COROUTINES_TS_FLAG )
7
+ check_cxx_compiler_flag(-fcoroutines Coroutines_SUPPORTS_COROUTINES_FLAG )
8
+ if (Coroutines_SUPPORTS_MS_FLAG OR Coroutines_SUPPORTS_COROUTINES_TS_FLAG OR Coroutines_SUPPORTS_COROUTINES_FLAG )
9
9
set (Coroutines_COMPILER_SUPPORT ON )
10
10
endif ()
11
11
12
12
if (Coroutines_SUPPORTS_MS_FLAG)
13
- check_include_file_cxx("coroutine" Coroutines_STANDARD_LIBRARY_SUPPORT "/await" )
14
- check_include_file_cxx("experimental/coroutine" Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT "/await" )
15
- elseif (Coroutines_ts_SUPPORTS_GNU_FLAG)
16
- check_include_file_cxx("coroutine" Coroutines_STANDARD_LIBRARY_SUPPORT "-fcoroutines-ts" )
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" )
13
+ set (Coroutines_EXTRA_FLAGS "/await" )
14
+ elseif (Coroutines_SUPPORTS_COROUTINES_TS_FLAG)
15
+ set (Coroutines_EXTRA_FLAGS "-fcoroutines-ts" )
16
+ elseif (Coroutines_SUPPORTS_COROUTINES_FLAG)
17
+ set (Coroutines_EXTRA_FLAGS "-fcoroutines" )
21
18
endif ()
22
19
20
+ check_include_file_cxx("coroutine" Coroutines_STANDARD_LIBRARY_SUPPORT ${Coroutines_EXTRA_FLAGS} )
21
+ check_include_file_cxx("experimental/coroutine" Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT ${Coroutines_EXTRA_FLAGS} )
22
+
23
23
if (Coroutines_EXPERIMENTAL_LIBRARY_SUPPORT OR Coroutines_STANDARD_LIBRARY_SUPPORT)
24
24
set (Coroutines_LIBRARY_SUPPORT ON )
25
25
endif ()
@@ -33,12 +33,4 @@ if(NOT CppcoroCoroutines_FOUND OR TARGET cppcoro::coroutines)
33
33
endif ()
34
34
35
35
add_library (cppcoro::coroutines INTERFACE IMPORTED )
36
- if (Coroutines_SUPPORTS_MS_FLAG)
37
- target_compile_options (cppcoro::coroutines INTERFACE /await)
38
- elseif (Coroutines_ts_SUPPORTS_GNU_FLAG)
39
- target_compile_options (cppcoro::coroutines INTERFACE -fcoroutines-ts)
40
- elseif (Coroutines_SUPPORTS_GNU_FLAG)
41
- target_compile_options (cppcoro::coroutines INTERFACE -fcoroutines)
42
- endif ()
43
-
44
36
target_compile_options (cppcoro::coroutines INTERFACE ${Coroutines_EXTRA_FLAGS} )
0 commit comments