Skip to content

Commit 3689d4c

Browse files
committed
[CMake] Added support for disabling building the SourceKit XPC service.
Made `BUILD_SOURCEKIT_XPC_SERVICE` into an option so it can be set externally. It continues to default to `TRUE` if `HAVE_XPC_H AND SWIFT_BUILD_SOURCEKIT` is true, and `FALSE` otherwise, but this allows a client to disable this ahead of time and build a sourcekitd.framework without the XPC service. This addresses <rdar://problem/85511711>.
1 parent cd8da12 commit 3689d4c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ include(CheckIncludeFiles)
22
check_include_files("xpc/xpc.h" HAVE_XPC_H)
33

44
if(HAVE_XPC_H AND SWIFT_BUILD_SOURCEKIT)
5-
set(BUILD_SOURCEKIT_XPC_SERVICE TRUE)
5+
set(BUILD_SOURCEKIT_XPC_SERVICE_default TRUE)
66
else()
7-
set(BUILD_SOURCEKIT_XPC_SERVICE FALSE)
7+
set(BUILD_SOURCEKIT_XPC_SERVICE_default FALSE)
88
endif()
99

10+
option(BUILD_SOURCEKIT_XPC_SERVICE
11+
"Whether or not the SourceKit XPC service should be built"
12+
${BUILD_SOURCEKIT_XPC_SERVICE_default})
13+
1014
# Add generated libSyntax headers to global dependencies.
1115
list(APPEND LLVM_COMMON_DEPENDS swift-syntax-generated-headers)
1216
if(SWIFT_BUILD_SOURCEKIT)

0 commit comments

Comments
 (0)