Skip to content

Commit d7b813b

Browse files
committed
[sourcekit] Identify xpc service by toolchain instead of sdk
rdar://72310494
1 parent c9ef005 commit d7b813b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

tools/SourceKit/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ configure_file(
3131
set(SOURCEKIT_DEPLOYMENT_OS "${SWIFT_HOST_VARIANT}")
3232
set(SOURCEKIT_DEPLOYMENT_TARGET "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_DEPLOYMENT_VERSION}")
3333

34-
STRING(TOLOWER "${SWIFT_PRIMARY_VARIANT_SDK}" SOURCEKIT_PLATFORM_NAME)
35-
# Remove '_simulator' from the name if it exists
36-
STRING(REPLACE "_simulator" "" SOURCEKIT_PLATFORM_NAME "${SOURCEKIT_PLATFORM_NAME}")
34+
set(SOURCEKIT_TOOLCHAIN_NAME "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}")
35+
if("${SOURCEKIT_TOOLCHAIN_NAME}" MATCHES "XcodeDefault")
36+
set(SOURCEKIT_TOOLCHAIN_NAME "default")
37+
endif()
3738

3839
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND NOT CMAKE_CROSSCOMPILING)
3940
set(CMAKE_OSX_SYSROOT "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_PATH}")

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ macro(add_sourcekit_xpc_service name framework_target)
333333
endif()
334334

335335
set(XPCSERVICE_NAME ${name})
336-
set(XPCSERVICE_IDENTIFIER "com.apple.${name}.${SOURCEKIT_VERSION_STRING}_${SOURCEKIT_PLATFORM_NAME}")
336+
set(XPCSERVICE_IDENTIFIER "com.apple.${name}.${SOURCEKIT_VERSION_STRING}_${SOURCEKIT_TOOLCHAIN_NAME}")
337337
set(XPCSERVICE_BUNDLE_VERSION "${SOURCEKIT_VERSION_STRING}")
338338
set(XPCSERVICE_SHORT_VERSION_STRING "1.0")
339339
configure_file(

tools/SourceKit/tools/sourcekitd/bin/XPC/Client/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ add_sourcekit_framework(sourcekitd
1616
)
1717
target_link_libraries(sourcekitd PRIVATE sourcekitdAPI)
1818

19-
add_definitions(-DSOURCEKIT_XPCSERVICE_IDENTIFIER="com.apple.SourceKitService.${SOURCEKIT_VERSION_STRING}_${SOURCEKIT_PLATFORM_NAME}")
19+
add_definitions(-DSOURCEKIT_XPCSERVICE_IDENTIFIER="com.apple.SourceKitService.${SOURCEKIT_VERSION_STRING}_${SOURCEKIT_TOOLCHAIN_NAME}")
2020

2121
if (SOURCEKIT_BUILT_STANDALONE)
2222
# Create the symlink necessary to find the swift stdlib.

0 commit comments

Comments
 (0)