Description
Describe the bug
Clang provides some C headers as polyfills (or shims) and the Swift toolchain vendors it in /usr/lib/clang/{clang_version}/include
. However, the Swift compiler doesn’t recognize these headers, so a module produced by the bundled Clang may not be consumed by Swift.
Steps To Reproduce
Steps to reproduce the behavior:
- Clone
https://github.com/apple/swift-atomics
; - Change directory to
swift-atomics
; - Run
swift build
.
Expected behavior
Since the _AtomicsShims
target is successfully compiled, it should be consumable for Atomics
.
Environment
- OS: Windows Server 2019 Datacenter (1809)
- Swift version: 5.6.2
- Visual Studio: Community 2019, 16.11.18
Additional context
Although this can be worked around from the SwiftPM side, I believe resolving it with swiftc
is a better choice.