Skip to content

[cxx-interop] Copy bridging header to same directory as other headers #72201

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

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

drodriguez
Copy link
Contributor

The bridging header for C++ interop was calculating an include directory using CMAKE_BINARY_DIR and CMAKE_CFG_INTDIR while the rest of the headers consistently use CMAKE_CURRENT_BINARY_DIR and no CMAKE_CFG_INTDIR.

In some configurations of CMake (for example when using Swift as an external project of LLVM and building an unified toolchain), this means that the brigding header will end up in a different directory than the rest of the headers, which complicates testing.

The changes in this commit reuses SWIFT_INCLUDE_DIR to keep consistency with the rest of the headers. Any build started by build-script should not notice the difference.

@drodriguez drodriguez added the c++ interop Feature: Interoperability with C++ label Mar 8, 2024
@drodriguez
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor

Thanks @drodriguez!
Looks like there's a merge conflict since I landed #72186 a few days ago, would you mind rebasing this?

The `bridging` header for C++ interop was calculating an include
directory using `CMAKE_BINARY_DIR` and `CMAKE_CFG_INTDIR` while the rest
of the headers consistently use `CMAKE_CURRENT_BINARY_DIR` and no
`CMAKE_CFG_INTDIR`.

In some configurations of CMake (for example when using Swift as an
external project of LLVM and building an unified toolchain), this means
that the `brigding` header will end up in a different directory than the
rest of the headers, which complicates testing.

The changes in this commit reuses `SWIFT_INCLUDE_DIR` to keep
consistency with the rest of the headers. Any build started by
`build-script` should not notice the difference.
@drodriguez drodriguez force-pushed the cxx-bridging-header-location branch from 0ed9f18 to c5580b2 Compare March 12, 2024 22:18
@drodriguez
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@drodriguez drodriguez merged commit f9a42ec into swiftlang:main Mar 13, 2024
@drodriguez drodriguez deleted the cxx-bridging-header-location branch March 13, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants