Skip to content

Match the CMake install path for _InternalSwiftScan with its installed location on Windows #64364

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

Closed
wants to merge 1 commit into from
Closed

Match the CMake install path for _InternalSwiftScan with its installed location on Windows #64364

wants to merge 1 commit into from

Conversation

tristanlabelle
Copy link
Contributor

@tristanlabelle tristanlabelle commented Mar 14, 2023

Updates the CMake install directory paths for _InternalSwiftScan such that files are at the same relative location in the build output as they end up after running a Swift installer (so the cmake-installed directory and an installer-installed Swift can be used interchangeably). The /swift/windows component of the path was not useful on Windows.

(see further explanation by compnerd in comments below)

Co-dependent with swiftlang/swift-installer-scripts#179

RUNTIME DESTINATION "bin" COMPONENT compiler)

swift_install_in_component(DIRECTORY "${SWIFT_MAIN_INCLUDE_DIR}/swift-c/DependencyScan/"
DESTINATION "include/${SWIFT_SCAN_LIB_NAME}"
Copy link
Member

Choose a reason for hiding this comment

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

Should this be ${CMAKE_INSTALL_INCLUDE_DIR}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but that is #64281 . The changes will conflict and I will add the ${CMAKE_INSTALL_INCLUDE_DIR} in the PR I get to rebase on the other.

ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" COMPONENT compiler
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" COMPONENT compiler
RUNTIME DESTINATION "bin" COMPONENT compiler)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this should use SWIFT_HOST_SDK_VARIANT or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe but it looks like it's already working ok so... different change?

Copy link
Member

Choose a reason for hiding this comment

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

You cross-compiled with multiple SDKs?

@compnerd
Copy link
Member

CC: @bnbarham @etcwilde

@compnerd
Copy link
Member

CC: @DougGregor

@DougGregor this might be an interesting case. We are using /usr/lib/swift/host on Linux (and Darwin?) to avoid making internal libraries visible by default. However, Windows does not have a default search path for the libraries and everything is specified (either via the command line or environment variables) and thus, installing the import libraries and headers for the host libraries into the toolchain root makes some sense. Additionally, anything that the compiler actually needs to run will have to be in bin anyway as it needs to be next to the executable since there is no equivalent of LC_RPATH or DT_RUNPATH/DT_RPATH in PE/COFF. I figure that you may have thoughts on this.

@tristanlabelle
Copy link
Contributor Author

Closing due to age

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