Skip to content

Commit 6c8c715

Browse files
committed
SourceKit: repair the build when cross-compiling
Not all targets (CMAKE_SYSTEM_NAME) use `lib` and `.a` for the static library name. Adjust the name properly for the host that we are building for. This repairs the build when performing a cross-compile from Linux to Windows.
1 parent 724e63a commit 6c8c715

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ macro(add_sourcekit_library name)
158158
set(prefixed_link_libraries)
159159
foreach(dep ${SOURCEKITLIB_LINK_LIBS})
160160
if("${dep}" MATCHES "^clang")
161-
set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
161+
set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${dep}${CMAKE_STATIC_LIBRARY_SUFFIX}")
162162
endif()
163163
list(APPEND prefixed_link_libraries "${dep}")
164164
endforeach()

0 commit comments

Comments
 (0)