[cxx-interop] Move swift/bridging header to clang resource dir#88748
Open
j-hui wants to merge 1 commit intoswiftlang:mainfrom
Open
[cxx-interop] Move swift/bridging header to clang resource dir#88748j-hui wants to merge 1 commit intoswiftlang:mainfrom
j-hui wants to merge 1 commit intoswiftlang:mainfrom
Conversation
The swift/bridging header provides annotation macros (e.g., SWIFT_SHARED_REFERENCE, SWIFT_COMPUTED_PROPERTY) for C++ code that interoperate with Swift. Previously, this header was shipped in the Swift toolchain's usr/include, which is not part of Clang's default search paths in the OSS toolchain, which forced users to manually pass -I flags to find the header. By placing it in Clang's resource directory, the header is automatically discoverable by both clang and swift (via its embedded Clang instance), since both already search <clang-resource-dir>/include by default. In addition to removing lib/ClangImporter/SwiftBridging/, where the swift/bridging lived, this patch also removes build settings related to the bridging header (SWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER and the --enable-cxx-interop-swift-bridging-header build-script flag), as well as the explicit -I flags in interop tests pointing to the old SwiftBridging directory. rdar://136716355
Contributor
Author
|
@swift-ci please smoke test |
egorzhdan
approved these changes
May 5, 2026
Contributor
egorzhdan
left a comment
There was a problem hiding this comment.
Thanks! This is the right way to go.
Xazax-hun
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
swift/bridgingheader from the Swift repo to Clang's resource directory ([cxx-interop] Move swift/bridging header to clang resource dir llvm-project#12861), so that it can be found via default search paths.#include <swift/bridging>continues to work via Clang's resource directory. In the Swift repo,__has_includefallback inSwiftBridging.hprovides compatibility with older Clang builds.