File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,21 @@ gtest_discover_tests(httplib-test)
3333
3434# C++20 streaming API tests
3535if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang|MSVC" )
36- # Check for C++20 support
37- include (CheckCXXCompilerFlag)
36+ # Check for C++20 support using CMake's compile features
37+ # This is more reliable than checking compiler flags
3838 if (MSVC )
39- check_cxx_compiler_flag("/std:c++20" COMPILER_SUPPORTS_CXX20)
39+ # MSVC 19.29+ (VS 2019 16.10+) supports C++20 coroutines
40+ if (MSVC_VERSION GREATER_EQUAL 1929)
41+ set (COMPILER_SUPPORTS_CXX20 TRUE )
42+ else ()
43+ set (COMPILER_SUPPORTS_CXX20 FALSE )
44+ endif ()
4045 else ()
46+ include (CheckCXXCompilerFlag)
4147 check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
4248 endif ()
4349
50+ message (STATUS "Compiler: ${CMAKE_CXX_COMPILER_ID} , MSVC_VERSION: ${MSVC_VERSION} " )
4451 message (STATUS "C++20 support: ${COMPILER_SUPPORTS_CXX20} " )
4552
4653 if (COMPILER_SUPPORTS_CXX20)
You can’t perform that action at this time.
0 commit comments