Skip to content

[Runtimes][CMake] Find Shims, OnoneSupport and Concurrency in FindSwi… #81982

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Jun 4, 2025

…ftCore

This way we will match most of the targets that would be exported via SwiftCoreTargets.cmake.

Take the chance to amend the path to SwiftCore library for Windows.

Addresses rdar://151700875

…ftCore

This way we will match most of the targets that would be exported via
`SwiftCoreTargets.cmake`.

Take the chance to amend the path to SwiftCore library for Windows.

Addresses rdar://151700875
@edymtt
Copy link
Contributor Author

edymtt commented Jun 4, 2025

@swift-ci please smoke test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I wonder if we want to try to share most of the search logic across the platforms. The differences are the PLATFORM_SUBDIR, which we can compute per platform or use the computation.

INTERFACE_INCLUDE_DIRECTORIES "${Shims_INCLUDE_DIR}/shims")
target_link_libraries(swiftCore
INTERFACE
swiftShims)
Copy link
Member

Choose a reason for hiding this comment

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

Indentation is off

find_path(Shims_INCLUDE_DIR
"shims/module.modulemap"
HINTS
"${Swift_SDKROOT}/usr/lib/swift")
Copy link
Member

Choose a reason for hiding this comment

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

Should we use ${Swift_SDKROOT}/usr/lib/swift_static as a primary hint?

elseif(WIN32)
find_path(SwiftCore_INCLUDE_DIR
"Swift.swiftmodule"
HINTS
"${Swift_SDKROOT}/usr/lib/swift/windows"
"$ENV{SDKROOT}/usr/lib/swift/windows")
find_library(SwiftCore_LIBRARY
NAMES "libswiftCore.lib"
NAMES "swiftCore.lib"
Copy link
Member

Choose a reason for hiding this comment

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

This needs a if(BUILD_SHARED_LIBS) clause around this. The import library for swiftCore is swiftCore.lib, the static library is libswiftCore.lib.

edymtt added a commit to edymtt/swift that referenced this pull request Jun 5, 2025
@edymtt
Copy link
Contributor Author

edymtt commented Jun 5, 2025

I attempted to refactor the existing code putting more emphasis on the search and the target in #82035 -- @compnerd, could you have a peek at that and check if that goes in the direction you have in mind? Unfortunately the diff is a bit noisy

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.

2 participants