Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-cl doesn't recoganise command line option "-fcoroutines-ts" #84

Closed
missdeer opened this issue Jun 23, 2022 · 0 comments
Closed

clang-cl doesn't recoganise command line option "-fcoroutines-ts" #84

missdeer opened this issue Jun 23, 2022 · 0 comments

Comments

@missdeer
Copy link

missdeer commented Jun 23, 2022

As titled. But it works like MSVC, leaving blank is OK. Maybe something like below:

macro(qcoro_enable_coroutines)
    if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
    elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines-ts")
    elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
        if (MSVC)
            # Clang-cl works like MSVC that auto-enables coroutine support when C++20 is enabled
        else()
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines-ts")
        endif()
    elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
        # MSVC auto-enables coroutine support when C++20 is enabled
    else()
        message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} is not currently supported.")
    endif()
endmacro()
danvratil added a commit that referenced this issue Jun 23, 2022
danvratil added a commit that referenced this issue Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant