Skip to content

Commit 5268ce4

Browse files
authored
Merge pull request #28270 from compnerd/sourcekit-simplify
Simplify SourceKit CMake
2 parents d6619e5 + 7722d43 commit 5268ce4

File tree

3 files changed

+15
-29
lines changed

3 files changed

+15
-29
lines changed

tools/SourceKit/lib/Support/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
set(SourceKitSupport_sources
1+
add_sourcekit_library(SourceKitSupport
22
Concurrency-libdispatch.cpp
33
FuzzyStringMatcher.cpp
44
Logging.cpp
55
ImmutableTextBuffer.cpp
66
ThreadSafeRefCntPtr.cpp
77
Tracing.cpp
88
UIDRegistry.cpp
9-
)
10-
11-
add_sourcekit_library(SourceKitSupport
12-
${SourceKitSupport_sources}
139
LINK_LIBS swiftBasic swiftSyntax clangBasic clangRewrite
1410
)
1511
if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
set(LLVM_OPTIONAL_SOURCES
2+
sourcekitdAPI-XPC.cpp
3+
sourcekitdAPI-InProc.cpp)
14

2-
set(sourcekitdAPI_sources
5+
add_sourcekit_library(sourcekitdAPI
36
CodeCompletionResultsArray.cpp
47
CompactArray.cpp
58
DocStructureArray.cpp
@@ -9,22 +12,14 @@ set(sourcekitdAPI_sources
912
sourcekitdAPI-Common.cpp
1013
TokenAnnotationsArray.cpp
1114
ExpressionTypeArray.cpp
15+
LINK_LIBS
16+
SourceKitSupport SourceKitSwiftLang
1217
)
1318

14-
set(sourcekitdAPI_Darwin_sources
15-
sourcekitdAPI-XPC.cpp)
16-
set(sourcekitdAPI_NonDarwin_InProc_sources
17-
sourcekitdAPI-InProc.cpp)
18-
set(LLVM_OPTIONAL_SOURCES ${sourcekitdAPI_Darwin_sources} ${sourcekitdAPI_NonDarwin_InProc_sources})
19-
2019
if(APPLE AND HAVE_XPC_H)
21-
list(APPEND sourcekitdAPI_sources ${sourcekitdAPI_Darwin_sources})
20+
target_sources(sourcekitdAPI PRIVATE
21+
sourcekitdAPI-XPC.cpp)
2222
elseif(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
23-
list(APPEND sourcekitdAPI_sources ${sourcekitdAPI_NonDarwin_InProc_sources})
23+
target_sources(sourcekitdAPI PRIVATE
24+
sourcekitdAPI-InProc.cpp)
2425
endif()
25-
26-
add_sourcekit_library(sourcekitdAPI
27-
${sourcekitdAPI_sources}
28-
LINK_LIBS
29-
SourceKitSupport SourceKitSwiftLang
30-
)

tools/SourceKit/tools/swift-lang/CMakeLists.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
if(NOT SWIFT_SOURCEKIT_USE_INPROC_LIBRARY AND SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
2-
set(EXTRA_COMPILE_FLAGS "-F" "${SWIFT_LIBRARY_OUTPUT_INTDIR}")
3-
set(SOURCEKITD_LINK_LIBS sourcekitd)
4-
set(INSTALLED_COMP sourcekit-xpc-service)
5-
set(DEPENDS_LIST "sourcekitd-test")
6-
72
# The build type of swiftlang should agree with stdlib
83
# This setting could avoid us adding additional search paths when building
94
# executables using SwiftLang.
@@ -25,11 +20,11 @@ if(NOT SWIFT_SOURCEKIT_USE_INPROC_LIBRARY AND SWIFT_BUILD_STDLIB AND SWIFT_BUILD
2520
GYB_SOURCES
2621
UIDs.swift.gyb
2722

28-
DEPENDS ${DEPENDS_LIST}
23+
DEPENDS sourcekitd-test
2924
SWIFT_MODULE_DEPENDS_OSX Darwin Foundation
30-
PRIVATE_LINK_LIBRARIES ${SOURCEKITD_LINK_LIBS}
31-
SWIFT_COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}
32-
INSTALL_IN_COMPONENT ${INSTALLED_COMP}
25+
PRIVATE_LINK_LIBRARIES sourcekitd
26+
SWIFT_COMPILE_FLAGS -F${SWIFT_LIBRARY_OUTPUT_INTDIR}
27+
INSTALL_IN_COMPONENT sourcekit-xpc-service
3328
DARWIN_INSTALL_NAME_DIR "@rpath"
3429
TARGET_SDKS ${SOURCEKIT_DEFAULT_TARGET_SDK}
3530
IS_STDLIB)

0 commit comments

Comments
 (0)