Skip to content

runtimes: add Android search handling for SwiftCore #81920

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
Jun 3, 2025

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Jun 3, 2025

This updates the search handling to account for Android SDK searches on Windows. This is required to repair the nightly builds.

This updates the search handling to account for Android SDK searches on
Windows. This is required to repair the nightly builds.
@compnerd
Copy link
Member Author

compnerd commented Jun 3, 2025

@swift-ci please smoke test

@etcwilde
Copy link
Member

etcwilde commented Jun 3, 2025

I think this is fine. That said, if we have the CMake generated config file, should we default these builds to use that instead with CMAKE_FIND_PACKAGE_PREFER_CONFIG?

Then CMake will pick the config file up automatically as long as the install directories are kept consistent.

@compnerd
Copy link
Member Author

compnerd commented Jun 3, 2025

Yes, I think that if possible, we should prefer the config files.

@compnerd
Copy link
Member Author

compnerd commented Jun 3, 2025

@swift-ci please smoke test Linux platform

@compnerd
Copy link
Member Author

compnerd commented Jun 3, 2025

@swift-ci please smoke test macOS platform

if(BUILD_SHARED_LIBS)
find_path(SwiftCore_INCLUDE_DIR
"Swift.swiftmodule"
NO_CMAKE_FIND_ROOT_PATH
Copy link
Contributor

Choose a reason for hiding this comment

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

To double check my understanding: are you using NO_CMAKE_FIND_ROOT_PATH to signal that we are not mixing and matching target and host environments?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is required to ensure that we do not mix and match the Android sysroot and the Swift sysroot. When building for Android, we would search for the path "[Android sysroot][Swift sysroot]" which would not exist as the paths are concatenated.

@compnerd compnerd merged commit b715147 into swiftlang:main Jun 3, 2025
3 checks passed
@compnerd compnerd deleted the search-party branch June 3, 2025 20:31
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.

3 participants