Skip to content

build: Install libraries in an arch sub-folder #5257

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

Steelskin
Copy link
Contributor

@Steelskin Steelskin commented Aug 7, 2025

This is the proper installation scheme for Swift libraries on Windows and prevents having to manually copy them in build.ps1.

@Steelskin
Copy link
Contributor Author

@swift-ci please test

@parkera parkera requested review from compnerd and jmschonfeld August 7, 2025 17:14
This is the proper installation scheme for Swift libraries and
prevents having to manually copy them in `build.ps1`.
@Steelskin Steelskin force-pushed the fabrice/build-install-swift-libraries-arch-folder branch from ef23f75 to ea40b13 Compare August 7, 2025 22:00
@Steelskin Steelskin marked this pull request as ready for review August 7, 2025 22:01
@Steelskin
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@jmschonfeld jmschonfeld left a comment

Choose a reason for hiding this comment

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

I'm still not entirely sure I'm following what this change is intended to do - could you elaborate on the background/context a bit more? My current understanding is that when we ship the toolchain we ship a single swift module with multiple architectures within it. Do I have that right? And if so, is this intending to change how that is done but only on some platforms where SwiftFoundation_INSTALL_ARCH_SUBDIR is set?

endif()

if(NOT SwiftFoundation_ARCH)
if(CMAKE_Swift_COMPILER_VERSION VERSION_EQUAL 0.0.0 OR CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 6.2)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these version checks are necessary - the main branch of Foundation must be built using at least a recent nightly snapshot of the main branch of the compiler, so this check should never fail

@@ -23,8 +70,8 @@ function(_foundation_install_target module)
endif()

install(TARGETS ${module}
ARCHIVE DESTINATION lib/${swift}/${swift_os}
LIBRARY DESTINATION lib/${swift}/${swift_os}
ARCHIVE DESTINATION lib/${swift}/${SwiftFoundation_PLATFORM}$<$<BOOL:${SwiftFoundation_INSTALL_ARCH_SUBDIR}>:/${SwiftFoundation_ARCH}>
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you're only applying the arch subdirectory at install time for the swift modules. What about the other C modules for the static SDK?

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