Skip to content

Commit 7136f78

Browse files
committed
Set install path of libSwiftScan to 'lib/swift/host' instead of platform-specific path string
1 parent d0b8b16 commit 7136f78

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tools/libSwiftScan/CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,25 @@ add_link_opts(libSwiftScan)
4646

4747
add_dependencies(compiler libSwiftScan)
4848
swift_install_in_component(TARGETS libSwiftScan
49-
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" COMPONENT compiler
50-
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}" COMPONENT compiler
49+
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host" COMPONENT compiler
50+
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/host" COMPONENT compiler
5151
RUNTIME DESTINATION "bin" COMPONENT compiler)
52+
53+
if(EXISTS ${LLVM_CMAKE_DIR}/LLVMInstallSymlink.cmake)
54+
set(INSTALL_SYMLINK ${LLVM_CMAKE_DIR}/LLVMInstallSymlink.cmake)
55+
endif()
56+
precondition(INSTALL_SYMLINK
57+
MESSAGE "LLVMInstallSymlink script must be available.")
58+
59+
file(RELATIVE_PATH target_install_relative_path
60+
${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}
61+
${CMAKE_INSTALL_PREFIX}/lib${LLVM_LIBDIR_SUFFIX}/swift/host/lib${SWIFT_SCAN_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
62+
install(SCRIPT ${INSTALL_SYMLINK}
63+
CODE "install_symlink(${SWIFT_SCAN_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
64+
${target_install_relative_path}
65+
lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR})"
66+
COMPONENT compiler)
67+
5268
swift_install_in_component(DIRECTORY "${SWIFT_MAIN_INCLUDE_DIR}/swift-c/DependencyScan/"
5369
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${SWIFT_SCAN_LIB_NAME}"
5470
COMPONENT compiler)

0 commit comments

Comments
 (0)