File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -150,10 +150,19 @@ endif()
150
150
151
151
if (find_final)
152
152
check_include_file_cxx("coroutine" _CXX_COROUTINES_HAVE_HEADER)
153
+ if (_CXX_COROUTINES_HAVE_HEADER)
154
+ check_cxx_source_compiles("#include <coroutine> \n typedef std::suspend_never blub; \n int main() {} " _CXX_COROUTINES_FINAL_HEADER_COMPILES)
155
+ set (_CXX_COROUTINES_HAVE_HEADER ${}_CXX_COROUTINES_FINAL_HEADER_COMPILES})
156
+ endif ()
157
+
153
158
if (NOT _CXX_COROUTINES_HAVE_HEADER)
154
159
cmake_push_check_state()
155
160
set (CMAKE_REQUIRED_FLAGS "${_CXX_COROUTINES_EXTRA_FLAGS} " )
156
161
check_include_file_cxx("coroutine" _CXX_COROUTINES_HAVE_HEADER_WITH_FLAG)
162
+ if (_CXX_COROUTINES_HAVE_HEADER_WITH_FLAG)
163
+ check_cxx_source_compiles("#include <coroutine> \n typedef std::suspend_never blub; \n int main() {} " _CXX_COROUTINES_FINAL_HEADER_COMPILES_WITH_FLAG)
164
+ set (_CXX_COROUTINES_HAVE_HEADER_WITH_FLAG ${_CXX_COROUTINES_FINAL_HEADER_COMPILES_WITH_FLAG} )
165
+ endif ()
157
166
set (_CXX_COROUTINES_HAVE_HEADER ${_CXX_COROUTINES_HAVE_HEADER_WITH_FLAG} )
158
167
cmake_pop_check_state()
159
168
endif ()
Original file line number Diff line number Diff line change 150
150
# define CPPCORO_CPU_CACHE_LINE 64
151
151
#endif
152
152
153
+ #if CPPCORO_COMPILER_MSVC
154
+ #if __has_include(<coroutine>)
155
+ #include < yvals_core.h>
156
+ #ifdef __cpp_lib_coroutine
157
+ #define CPPCORO_COROHEADER_FOUND_AND_USABLE
158
+ #endif
159
+ #endif
160
+ #else
161
+ #if __has_include(<coroutine>)
162
+ #define CPPCORO_COROHEADER_FOUND_AND_USABLE
163
+ #endif
164
+ #endif
165
+
153
166
#endif
Original file line number Diff line number Diff line change 1
1
#ifndef CPPCORO_COROUTINE_HPP_INCLUDED
2
2
#define CPPCORO_COROUTINE_HPP_INCLUDED
3
3
4
- #if __has_include(<coroutine>)
4
+ #include < cppcoro/config.hpp>
5
+
6
+ #ifdef CPPCORO_COROHEADER_FOUND_AND_USABLE
5
7
6
8
#include < coroutine>
7
9
You can’t perform that action at this time.
0 commit comments