Skip to content

Conversation

qmfrederik
Copy link
Contributor

On Windows, the Clang compiler can run with the GNU-like front end, or with a MSVC-like front-end. In both cases, it will generate core which is compatible with the MSVC runtime.

The CMAKE_C_SIMULATE_ID CMake variable relates to the runtime/binary compatibility is always set to MSVC.
The CMAKE_C_COMPILER_FRONTEND_VARIANT CMake variable relates to the front-end and can be used to differentiate between the GNU and MSVC front-end (command line syntax).

Therefore, use CMAKE_C_COMPILER_FRONTEND_VARIANT (instead of CMAKE_C_SIMULATE_ID) to determine whether command line arguments should be passed using the MSVC or GNU syntax.

This fixes compiling libdispatch on Windows using a "native" clang toolchain (e.g. clang instead of clang-cl).

qmfrederik added a commit to qmfrederik/conan-center-index that referenced this pull request Aug 12, 2025
- Add version 6.2.1 of libdispatch
- Support on Windows using the "native" Clang toolchain - see swiftlang/swift-corelibs-libdispatch#895
@compnerd
Copy link
Member

@swift-ci please test

@qmfrederik
Copy link
Contributor Author

Hi @compnerd the Windows build failure looks unrelated, should we retrigger the Windows build?

C:\Users\swift-ci\jenkins\workspace\swift-corelibs-libdispatch-PR-windows\swift-foundation\Sources\FoundationEssentials\JSON\JSONDecoder.swift:998:67: warning: capture of 'type' with non-Sendable type 'T.Type' in a '@Sendable' closure; this is an error in the Swift 6 language mode 

@compnerd
Copy link
Member

@swift-ci please test Windows platform

@compnerd compnerd merged commit 4c271c4 into swiftlang:main Aug 14, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants