Skip to content

[bug] v0.18.0+ does not recognize Clang with GNU-like command-line on Windows #459

@stephanvalentan

Description

@stephanvalentan

I've noticed that a compiler setup with clang (not clang-cl) is not auto-detected on windows any more.
This bug was introduced in the v0.18.0, while on v0.17.0 it works correctly.

The configuration is recognized by cmake like this:

CMAKE_C_COMPILER_ID = Clang
CMAKE_C_COMPILER_FRONTEND_VARIANT = GNU
CMAKE_C_SIMULATE_ID = MSVC

This setup is not recognized by the condition for clang:

...
elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang
        AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC"
        AND NOT "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC")
...

I think that the last condition can simply be dropped- clang that produces MSVC-ABI code should be recognized as clang.
Without this condition the setup is recognized correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions