Skip to content

Simplify SourceKit CMake #28270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions tools/SourceKit/lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
set(SourceKitSupport_sources
add_sourcekit_library(SourceKitSupport
Concurrency-libdispatch.cpp
FuzzyStringMatcher.cpp
Logging.cpp
ImmutableTextBuffer.cpp
ThreadSafeRefCntPtr.cpp
Tracing.cpp
UIDRegistry.cpp
)

add_sourcekit_library(SourceKitSupport
${SourceKitSupport_sources}
LINK_LIBS swiftBasic swiftSyntax clangBasic clangRewrite
)
if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
Expand Down
25 changes: 10 additions & 15 deletions tools/SourceKit/tools/sourcekitd/lib/API/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
set(LLVM_OPTIONAL_SOURCES
sourcekitdAPI-XPC.cpp
sourcekitdAPI-InProc.cpp)

set(sourcekitdAPI_sources
add_sourcekit_library(sourcekitdAPI
CodeCompletionResultsArray.cpp
CompactArray.cpp
DocStructureArray.cpp
Expand All @@ -9,22 +12,14 @@ set(sourcekitdAPI_sources
sourcekitdAPI-Common.cpp
TokenAnnotationsArray.cpp
ExpressionTypeArray.cpp
LINK_LIBS
SourceKitSupport SourceKitSwiftLang
)

set(sourcekitdAPI_Darwin_sources
sourcekitdAPI-XPC.cpp)
set(sourcekitdAPI_NonDarwin_InProc_sources
sourcekitdAPI-InProc.cpp)
set(LLVM_OPTIONAL_SOURCES ${sourcekitdAPI_Darwin_sources} ${sourcekitdAPI_NonDarwin_InProc_sources})

if(APPLE AND HAVE_XPC_H)
list(APPEND sourcekitdAPI_sources ${sourcekitdAPI_Darwin_sources})
target_sources(sourcekitdAPI PRIVATE
sourcekitdAPI-XPC.cpp)
elseif(SWIFT_SOURCEKIT_USE_INPROC_LIBRARY)
list(APPEND sourcekitdAPI_sources ${sourcekitdAPI_NonDarwin_InProc_sources})
target_sources(sourcekitdAPI PRIVATE
sourcekitdAPI-InProc.cpp)
endif()

add_sourcekit_library(sourcekitdAPI
${sourcekitdAPI_sources}
LINK_LIBS
SourceKitSupport SourceKitSwiftLang
)
13 changes: 4 additions & 9 deletions tools/SourceKit/tools/swift-lang/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
if(NOT SWIFT_SOURCEKIT_USE_INPROC_LIBRARY AND SWIFT_BUILD_STDLIB AND SWIFT_BUILD_SDK_OVERLAY)
set(EXTRA_COMPILE_FLAGS "-F" "${SWIFT_LIBRARY_OUTPUT_INTDIR}")
set(SOURCEKITD_LINK_LIBS sourcekitd)
set(INSTALLED_COMP sourcekit-xpc-service)
set(DEPENDS_LIST "sourcekitd-test")

# The build type of swiftlang should agree with stdlib
# This setting could avoid us adding additional search paths when building
# executables using SwiftLang.
Expand All @@ -25,11 +20,11 @@ if(NOT SWIFT_SOURCEKIT_USE_INPROC_LIBRARY AND SWIFT_BUILD_STDLIB AND SWIFT_BUILD
GYB_SOURCES
UIDs.swift.gyb

DEPENDS ${DEPENDS_LIST}
DEPENDS sourcekitd-test
SWIFT_MODULE_DEPENDS_OSX Darwin Foundation
PRIVATE_LINK_LIBRARIES ${SOURCEKITD_LINK_LIBS}
SWIFT_COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}
INSTALL_IN_COMPONENT ${INSTALLED_COMP}
PRIVATE_LINK_LIBRARIES sourcekitd
SWIFT_COMPILE_FLAGS -F${SWIFT_LIBRARY_OUTPUT_INTDIR}
INSTALL_IN_COMPONENT sourcekit-xpc-service
DARWIN_INSTALL_NAME_DIR "@rpath"
TARGET_SDKS ${SOURCEKIT_DEFAULT_TARGET_SDK}
IS_STDLIB)
Expand Down