Skip to content
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

[test] Fix tests that use Swift include directory in unified builds #78586

Merged

Conversation

drodriguez
Copy link
Contributor

In LLVM unified builds, Swift normally lives in tools/swift and the paths from the CMake build directory are not always the same as in a standalone build.

Fix some tests using %clang-include-dir (which effectively points to $CMAKE_BUILD_ROOT/include) to use the new %swift-include-dir, which should point to the right include/ directory in both unified and standalone builds.

Additionally, change the calculation of %clang-include-dir to not be relative to the swift binary, but to the CMake build root instead.

In LLVM unified builds, Swift normally lives in `tools/swift` and the
paths from the CMake build directory are not always the same as in
a standalone build.

Fix some tests using `%clang-include-dir` (which effectively points to
`$CMAKE_BUILD_ROOT/include`) to use the new `%swift-include-dir`, which
should point to the right `include/` directory in both unified and
standalone builds.

Additionally, change the calculation of `%clang-include-dir` to not be
relative to the `swift` binary, but to the CMake build root instead.
@drodriguez
Copy link
Contributor Author

@swift-ci please test

@drodriguez drodriguez marked this pull request as ready for review January 12, 2025 06:33
@drodriguez drodriguez requested a review from rjmccall as a code owner January 12, 2025 06:33
@drodriguez drodriguez merged commit 1363190 into swiftlang:main Jan 13, 2025
5 checks passed
@drodriguez drodriguez deleted the fix-clang-vs-swift-include-dir branch January 13, 2025 16:10
coffmark pushed a commit to coffmark/swift that referenced this pull request Jan 13, 2025
…wiftlang#78586)

In LLVM unified builds, Swift normally lives in `tools/swift` and the
paths from the CMake build directory are not always the same as in
a standalone build.

Fix some tests using `%clang-include-dir` (which effectively points to
`$CMAKE_BUILD_ROOT/include`) to use the new `%swift-include-dir`, which
should point to the right `include/` directory in both unified and
standalone builds.

Additionally, change the calculation of `%clang-include-dir` to not be
relative to the `swift` binary, but to the CMake build root instead.
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.

1 participant