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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions tools/libSwiftScan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ add_link_opts(libSwiftScan)
add_dependencies(compiler libSwiftScan)


if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
swift_install_in_component(TARGETS libSwiftScan
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?

swift_install_in_component(TARGETS libSwiftScan
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT compiler
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT compiler
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.

COMPONENT compiler)
else()
# On other platforms, instead install the library into 'lib/swift/host' and symlink to it from 'lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}'
swift_install_in_component(TARGETS libSwiftScan
Expand All @@ -75,8 +79,8 @@ else()
${target_install_relative_path}
lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR})"
COMPONENT compiler)
endif()

swift_install_in_component(DIRECTORY "${SWIFT_MAIN_INCLUDE_DIR}/swift-c/DependencyScan/"
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SCAN_LIB_NAME}"
COMPONENT compiler)
swift_install_in_component(DIRECTORY "${SWIFT_MAIN_INCLUDE_DIR}/swift-c/DependencyScan/"
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SCAN_LIB_NAME}"
COMPONENT compiler)
endif()